flutter - 发布开始时 Flutter 崩溃。E/LoadedApk:无法实例化 appComponentFactory,找不到类“com.example.androidx。17_4_2020
问题描述
我已将我的颤振升级到最新版本1.18.0-6.0.pre.65 • channel master
我的应用程序在发布时正在运行。但现在,它仅在调试模式下工作。并给出错误
E/LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn't find class "com.example.androidx" on path: DexPathList[[zip file "/data/app/com.example-w8uMhpPeS9WD7rhvuuQjbg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example-w8uMhpPeS9WD7rhvuuQjbg==/lib/x86, /data/app/com.example-w8uMhpPeS9WD7rhvuuQjbg==/base.apk!/lib/x86, /system/lib, /system/product/lib]]
我已经尝试了几乎所有可用的解决方案,例如:
1:invalidate cache,clean project,flutter clean,update,upgrade and rebuild
2:Add -keep class androidx.core.app.CoreComponentFactory { *; } to your proguard config so that this class won't be proguarded out
3-changed to stable channel
没有运气。4-创建新的颤振项目并发布它,给出了同样的错误。
我的毕业典礼:
android {
compileSdkVersion 'android-R'
defaultConfig {
applicationId "com.example"
minSdkVersion 16
targetSdkVersion 29
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
buildToolsVersion = '30.0.0 rc2'
解决方案
解决了!。对于任何人都会面临这个问题,问题是你使用的一些包。尝试在真实设备上运行 release 并检查日志以获取库 name.so 的名称并从其更改日志中降级其版本
推荐阅读
- elm - Elm 的 List 比 Javascript 的 Array 快吗?
- webrtc - WebRTC 中的两个端点都需要 STUN/TURN config/credentials
- javascript - 渲染后,事件未以 24 小时格式显示完整日历
- c# - 在.net core c#中从MongoDB获取动态对象而不是强类型
- javascript - 检查http响应状态码的最佳方法?
- c++ - 自动调用类静态函数 C++11
- javascript - jQuery 事件处理程序和创建临时新元素的并发问题
- processing - 是否可以创建图纸,将其保存为这样的格式,以便可以重新加载该图纸?
- csv - 在 SAP BODS 中读取带有双引号分隔符的 csv 文件
- jquery - JQuery在点击时在div之间切换