网站建设返回函数,门户网站建设工作领导小组,电商是什么?一般是干嘛的,wordpress圈子一. Flutter集成uni小程序sdk
1. 手机连接电脑测试打开uni小程序没问题#xff0c;打包成apk后debug编译下的apk也没问题#xff0c;但就是release编译的apk包打不开小程序。 报错情景#xff1a;点击后页面会闪现一下黑色的背景#xff0c;然后又跳转回了点击之前的页面。…一. Flutter集成uni小程序sdk
1. 手机连接电脑测试打开uni小程序没问题打包成apk后debug编译下的apk也没问题但就是release编译的apk包打不开小程序。 报错情景点击后页面会闪现一下黑色的背景然后又跳转回了点击之前的页面。 原因开启了混淆minifyEnabled true但又没有把混淆规则文件放入到指定的android目录中。 解决 打开android/app/build.gradle文件 minifyEnabled 设置成false或者把uni小程序sdk中的proguard.cfg文件放入到指定目录中。
buildTypes {release {// 注意点minifyEnabled 混淆和shrinkResources移除无用资源需同时为true或false否则可能导致编译失败minifyEnabled false //是否进行混淆shrinkResources false //删除无用资源//指定混淆规则文件proguardFiles getDefaultProguardFile(proguard-android.txt), proguard-rules.pro, proguard.cfg// TODO: Add your own signing config for the release build.// Signing with the debug keys for now, so flutter run --release works.signingConfig signingConfigs.debug}}2. minifyEnabled 混淆和shrinkResources移除无用资源值不相同时有可能会导致编译报错。
landeMacBook-Pro:life_app lan$ flutter build apkFAILURE: Build failed with an exception.* Where:
Build file /Users/lan/Desktop/flutter-demo/life_app/android/build.gradle line: 25* What went wrong:
A problem occurred evaluating root project android.A problem occurred configuring project :app. com.android.builder.errors.EvalIssueException: Removing unused resources requires unused code shrinking to be turned on. See http://d.android.com/r/tools/shrink-resources.html for more information.* Try:Run with --stacktrace option to get the stack trace.Run with --info or --debug option to get more log output.Run with --scan to get full insights.* Get more help at https://help.gradle.org