Я получил RuntimeException
на сборке релиза, когда R8 включен вместе с существующей конфигурацией Proguard.Проверено "Не удалось проверить dex-файл. Не в порядке annotation_element name_idx" , не повезло, я нигде не установил -overloadaggressively
.Также пробовал с отключенным ProGuard в соответствии с «Android / java: Переход / Миграция с ProGuard на R8?» , все еще не работает.
Среда сборки выглядит следующим образом:
Android Studio : 3.4.1
com.android.tools.build:gradle:3.4.1
android.enableR8=true
android.enableD8=true
android.enableDesugar=true
Журнал аварий:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.your.pkg, PID: 25969
java.lang.RuntimeException: Unable to instantiate application com.your.pkg.YourApplication: java.lang.ClassNotFoundException: Didn't find class "com.your.pkg.YourApplication" on path: DexPathList[[zip file "/data/app/com.your.pkg-GEdf7lpr_eG0NIkHShudhA==/base.apk"],nativeLibraryDirectories=[/data/app/com.your.pkg-GEdf7lpr_eG0NIkHShudhA==/lib/arm64, /data/app/com.your.pkg-GEdf7lpr_eG0NIkHShudhA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:1069)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5889)
at android.app.ActivityThread.access$1100(ActivityThread.java:202)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1665)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:198)
at android.app.ActivityThread.main(ActivityThread.java:6729)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.your.pkg.YourApplication" on path: DexPathList[[zip file "/data/app/com.your.pkg-GEdf7lpr_eG0NIkHShudhA==/base.apk"],nativeLibraryDirectories=[/data/app/com.your.pkg-GEdf7lpr_eG0NIkHShudhA==/lib/arm64, /data/app/com.your.pkg-GEdf7lpr_eG0NIkHShudhA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:50)
at android.app.Instrumentation.newApplication(Instrumentation.java:1121)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1061)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5889)
at android.app.ActivityThread.access$1100(ActivityThread.java:202)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1665)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:198)
at android.app.ActivityThread.main(ActivityThread.java:6729)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.your.pkg-GEdf7lpr_eG0NIkHShudhA==/base.apk because: Failure to verify dex file '/data/app/com.your.pkg-GEdf7lpr_eG0NIkHShudhA==/base.apk': Out-of-order entry types: 21a8 then 21a8
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:810)
at android.app.LoadedApk.getResources(LoadedApk.java:1032)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2357)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5792)
Заранее спасибо!