我需要你的帮助。我从更新我的等级时出现运行时错误
- 实现'com.google.android.gms:play services-auth:15.0.1'
- 实现'com.facebook.android:facebookandroidsdk:4.27.0'
到:
- 实现'com.google.android.gms:play services-auth:15.0.1'
- 实现'com.facebook.android:facebookandroidsdk:4.27.0'
- 实现'com.google.android.gms:播放服务广告:15.0.1'
- 实现'com.facebook.android:受众网络sdk:4.27.0'
错误日志:E/AndroidRuntime:致命异常:main进程:id.android.steven.dev,PID:5539java.lang.RuntimeException:无法实例化应用程序id.android.steven.MyApplication:java.lang.ClassNotFoundException:在路径DexPathList[[zip file"/data/app/id.andrid.steven.dev-2/base.apk"]上找不到类"id.andrid=steven.MyApp">,nativeLibrary目录=[/data/app/id.android.teve.dev-2/lib/arm,/data/app/id.android.steven.dev.dev-2/base.apk!/lib/armeabi-v7a,/system/lib,/vvendor/lib]]在android.app.LoadedApk.makeApplication(LoadedApk.java:846)在android.app.ActivityThread.handleBindApplication(ActivityThreads.java:5944)在android.app.ActivityThread.-wrap3(ActivityThreads.java)在android.app.ActivityThread$H.handleMessage(ActivityThreads.java:1710)在android.os.Handler.dispatchMessage(Handler.java:102)在android.os.Looper.loop(Looper.java:154)在android.app.ActivityThread.main上(ActivityThreads.java:6776)位于java.lang.reflect.Method.ioke(本机方法)网址:com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)网址:com.android.internal.os.ZygoteInit.main(ZygoteNit.java:1386)引起原因:java.lang.ClassNotFoundException:在路径:DexPathList上找不到类"id.android.steven.MyApplication">[[zip文件"/data/app/id.android.steven-2/base.apk"],nativeLibraryDirectories=[/data/app/id.android.stedven.dev-2/lib/arm,/data/ap/id.android.steven-2-base.apk!/lib/armeabi-v7a,/system/lib,/vvendor/lib]]位于dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)位于java.lang.ClassLoader.loadClass(ClassLoader.java:380)位于java.lang.ClassLoader.loadClass(ClassLoader.java:312)在android.app.Instrumentation.newApplication(Instrumentation.java:1000)在android.app.LoadedApk.makeApplication(LoadedApk.java:835)在android.app.ActivityThread.handleBindApplication(ActivityThreads.java:5944)在android.app.ActivityThread.-wrap3(ActivityThreads.java)在android.app.ActivityThread$H.handleMessage(ActivityThreads.java:1710)在android.os.Handler.dispatchMessage(Handler.java:102)在android.os.Looper.loop(Looper.java:154)在android.app.ActivityThread.main上(ActivityThreads.java:6776)位于java.lang.reflect.Method.ioke(本机方法)网址:com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)网址:com.android.internal.os.ZygoteInit.main(ZygoteNit.java:1386)已抑制:java.io.io异常:无法从/data/app/id.android.steven.dev-2/base.apk打开dex文件,因为:无法验证dex文件'/data/ap/id.andrid.steven.dev-2/base.apk':顺序错误的annotation_element name_idx:681e然后681e在dalvik.system.DexFile.openDexFileNative(本机方法)位于dalvik.system.DexFile.openDexFile(DexFile.java:373)在dalvik.system.DexFile.(DexFile.java:113)在dalvik.system.DexFile.(DexFile.java:78)位于dalvik.system.DexPathList.loadDexFile(DexPathList.java:359)位于dalvik.system.DexPathList.makeElements(DexPathList.java:323)位于dalvik.system.DexPathList.makeDexElements(DexPathList.java:263)位于dalvik.system.DexPathList.(DexPathList.java:126)位于dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:48)位于dalvik.system.PathClassLoader.(PathClassLoader.java:64)网址:com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoader Factory.java:43)在android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)在android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:535)在android.app.LoadedApk.getClassLoader(LoadedApk.java:568)在android.app.ActivityThread.getTopLevelResources(ActivityThreads.java:2053)在android.app.LoadedApk.getResources(LoadedApk.java:787)在android.app.ContextImpl.(ContextImpl.java:2226)在android.app.ContextImpl.createAppContext(ContextImpl.java:2210)在android.app.ContextImpl.createAppContext(ContextImpl.java:2196)在android.app.ActivityThread.handleBindApplication(ActivityThreads.java:5861)…还有8个
提前感谢:)
只需检查应用程序gradle中是否存在-overloadaggressively
,此方法就会强制重载所有方法。如果您使用-overloadaggressively
,只需禁用它并使用另一种方式。
请参阅此链接。
在Gradle更新后,地雷断了。回来了,一切都很好。我认为这与上述情况有关。评论的版本是突破性的变化。
渐变包装器属性:
distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-bin.zip
#distributionUrl=https://services.gradle.org/distributions/gradle-7.4-bin.zip
build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
//classpath 'com.android.tools.build:gradle:7.3.0'