Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease

不打扰是莪最后的温柔 提交于 2019-11-28 04:30:00
A.N.T

add the below to your ProGuard rules

-ignorewarnings

-keep class * {
    public private *;
}

and rebuild your project.

try this at your proguard-rules.pro

-ignorewarnings
-keep class * {
    public private *;
}

Only -ignorewarnings this line solved my problem.

Also Add the following line to <ProjectRoot>/android/gradle.properties to Obfuscating Dart Code:

extra-gen-snapshot-options=--obfuscate

For reference

Also If you using Firebase Auth please add it to proguard-rules.pro file:

-keep class com.google.firebase.** { *; }

Sharing my /android/app/proguard-rules.pro file

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

Hope someone will help this

You can try this keep class com.xyz.** { *; } -dontwarn com.xyz.**

Close the project and Android Studio. Open the project again, rebuild the project. And then you can try to generate the APK. That's worked for me. Though wired!

Ayaz Muhammad
buildTypes { release { shrinkResources true minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }

Please remove this line of code in your gradle. This worked for me. thanks in advance

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!