Я обновил свой флаттер до последней версии 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- Создал новый проект флаттера и выпустил его, выдает ту же ошибку.
Мой gradle:
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'