1.按照官方文档生成签名文件,修改build文件和manifest文件:
https://flutterchina.club/android-release/
2.注意AndroidX的适配问题,详见:
https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility#recommended-use-android-studio-to-migrate-your-app
3.release模式混淆压缩注意事项:
在 "proguard-rules.pro" 文件中,我们就要加入 -dontwarn 语句对第三方库进行报错屏蔽,否则proguard的代码混淆无法进行
#Flutter Wrapper
-dontwarn io.flutter.**
-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.** { *; }
网友评论