Coder Social home page Coder Social logo

Comments (16)

britannio avatar britannio commented on July 17, 2024 36

Where is this line supposed to go exactly? I know it says on the proguard file but, according to the docs it says it should be there in the project auto-generated, but in my case is not, do I suppose to create it?

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.

from device_calendar.

britannio avatar britannio commented on July 17, 2024 13

I had a similar issue due to Proguard. I fixed it by adding the following line to my Proguard file.
-keep class com.builttoroam.devicecalendar.** { *; }

from device_calendar.

MaikuB avatar MaikuB commented on July 17, 2024 1

We suspect this is related to the use of Proguard and we'll investigate

from device_calendar.

nickrandolph avatar nickrandolph commented on July 17, 2024 1

@thanhhuan1990 can you elaborate more on what the issue is/way - if would help others if we can document what the issue was

from device_calendar.

MaikuB avatar MaikuB commented on July 17, 2024 1

Thanks @britannio, we planned to do so

from device_calendar.

thanhhuan1990 avatar thanhhuan1990 commented on July 17, 2024

Thank for your response. I found problem myself but forgot update issue, it's really problem when release with Proguard, sorry for wasting your time.

from device_calendar.

britannio avatar britannio commented on July 17, 2024

Might be worth adding it to the readme.

from device_calendar.

Iiridayn avatar Iiridayn commented on July 17, 2024

As an aside, turns out everyone is a proguard user now... This fixed my issue, even though I'm using a standard autogen flutter project with the latest release, etc. Finding it was a lucky stroke. Can how to create a proper proguard file be documented? I added the line from this issue to the file documented here https://flutter.dev/docs/deployment/android#step-1---configure-proguard .

from device_calendar.

eliseyOzerov avatar eliseyOzerov commented on July 17, 2024

This solution worked for me for the Android build, what about the iOS? Because this bug is happening to my app on iOS as well.

from device_calendar.

chuckinSpace avatar chuckinSpace commented on July 17, 2024

Where is this line supposed to go exactly? I know it says on the proguard file but, according to the docs it says it should be there in the project auto-generated, but in my case is not, do I suppose to create it?

from device_calendar.

Ananthan1996 avatar Ananthan1996 commented on July 17, 2024

Now I can retrieve calendars in release mode by adding proguard. But for release mode deletion of event is not working.Can anyone help me in this case.I have an important feature to release.

from device_calendar.

technoAri avatar technoAri commented on July 17, 2024

@britannio android/app/proguard-rules.pro - this would be inside the flutter app's android/app or inside the plugin's?

from device_calendar.

britannio avatar britannio commented on July 17, 2024

@britannio android/app/proguard-rules.pro - this would be inside the flutter app's android/app or inside the plugin's?

Inside your Flutter app.

from device_calendar.

jurgenramirez avatar jurgenramirez commented on July 17, 2024

I did not have the pro guard files before and I am creating the apk as follows
flutter build apk --release
I have added the solution that they mention but it does not work, it seems that when I generate the apk it does not take the proguard

in the gradle.properties located in android/gradle.properties add this line

android.enableR8=true

in android/app/build.gradle file add
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

and add the file
android/app/proguard-rules.pro

#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.
* { *; }

from device_calendar.

fraboniface avatar fraboniface commented on July 17, 2024

As someone who just spent a full day on this thinking the problem came from somewhere else, you can follow the steps from @jurgenramirez but do use the proguard file of @britannio, with the endings in .** { *; }.

from device_calendar.

rajatency avatar rajatency commented on July 17, 2024

Where is this line supposed to go exactly? I know it says on the proguard file but, according to the docs it says it should be there in the project auto-generated, but in my case is not, do I suppose to create it?

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.

Works!

from device_calendar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.