Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Android Integration on pub.dev #250

Closed
Plateria opened this issue Jun 25, 2020 · 4 comments
Closed

Change Android Integration on pub.dev #250

Plateria opened this issue Jun 25, 2020 · 4 comments

Comments

@Plateria
Copy link
Contributor

Plateria commented Jun 25, 2020

I had the issue, that when i built a release version of my app containing the device_calendar plugin, the retrieve_calendars() function didn't work at all. After finding the solution to my problem #99 i suggest that you should add the following to pub.dev/device_calendar#android-integration, because you have to add the proguard rule anyways to make it work.

android/app/proguard-rules.pro
Mine looks like this:

#Flutter Wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }

# You might not be using firebase
# -keep class com.google.firebase.** { *; }
-keep class com.builttoroam.devicecalendar.** { *; }

then in android/app/build.gradle add the following line to buildTypes { release {}}
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

I also use minifyEnabled true and shrinkResources true in the same place.

Finally under android/gradle.properties I have android.enableR8=true, R8 still respects your proguard rules.

This solution is copied from here

@nickrandolph
Copy link
Contributor

An you check the readme (https://github.com/builttoroam/device_calendar) and if changes required, please submit a pr. I will check what's being published to pub.dev and update that when I can.

Thanks

@Plateria
Copy link
Contributor Author

Yea i checked the README. My suggestion is to change:

If you have Proguard enabled, you may need to add the following to your configuration (thanks to Britannio Jarrett who posted about it here)

to:

If you want to release the app, you have to enable proguard and follow these steps...

@jurgenramirez
Copy link

I compiled the application with flutter build apk --release and it did not have any proguard file I followed the steps mentioned but it does not work it still does not write to the calendar, from the emulator it works but when I install the apk on a device it does not work, help please.

@Plateria
Copy link
Contributor Author

Plateria commented Aug 2, 2022

@jurgenramirez Which steps did you exactly do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants