Open akmjenkins opened 3 years ago
Hello, if you are using Proguard, you will need to add the rules to avoid the obfuscator from stripping away needed classes. It is mentioned on the Android Setup Guide
@edTheGuy00 thanks for the reply!
On my debugging journey before I posted this issue, I added android/app/proguard-rules.pro
to my project with:
-keep class com.myappname.suffix.BuildConfig { *; }
And it did not solve my issue.
Just to double check again, You replaced com.myappname.suffix
with YOUR app name correct? For example, in my app I would have
-keep class com.byneapp.coolApp.BuildConfig { *; }
Secondly, I'm not 100% sure that is correct, I think you might also need to add the FlutterConfigPlugin class.
-keep class com.byneapp.flutter_config.FlutterConfigPlugin { *; }
Can you check for me? I normally just skip using pro-guard alltogether as I normally have to manually add almost every single Native Class into it, which makes it pretty useless for me and only saves a few KB on APK size.
Just to double check again, You replaced com.myappname.suffix with YOUR app name correct?
Yes.
I've also added:
-keep class com.myappname.flutter_config.FlutterConfigPlugin { *; }
with no luck.
How can I disable proguard? I noticed in my gradle.properties
file there's this android.enableR8=true
and I was starting to wondering if R8
had anything to do with this?
Same issue, no luck so far
According to the documentation here, if you use applicationIdSuffix
i.e. com.yourorg.mobile.suffix
that is different from the package name indicated in your AndroidManifest.xml
you need to add line in your android/app/build.gradle
file.
defaultConfig {
...
resValue "string", "build_config_package", "YOUR_PACKAGE_NAME_IN_ANDROIDMANIFEST.XML"
}
Works fine in debug mode, when I run it in release mode I get this trace from
await FlutterConfig.loadEnvVariables()
EDIT: Was originally running v 1.0.8. Upgraded to 2.0.0, issue exists (for me) in both
Mandatory
flutter doctor -v
Also worth pointing out that when I build, I get these gradle warnings - not sure if they are related or not to my issue: