我确实需要帮助来了解运行时错误

时间:2019-06-01 07:58:24

标签: android exception runtime

我有以下错误,这将导致我的android应用程序跳出,它跳出的位置非常不一致,我无法指出导致它的代码。任何人都可以阅读并理解它是什么?

E/AndroidRuntime: FATAL EXCEPTION: Thread-22
    Process: my.zen.com.uselessapp.xxxxxxxx, PID: 16384
    java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
        at com.google.android.gms.internal.ads.zzaj.zzb(Unknown Source:3)
        at com.google.android.gms.internal.ads.zzai.zza(Unknown Source:4)
        at com.google.android.gms.internal.ads.zzak.zzc(Unknown Source:32)
        at com.google.android.gms.internal.ads.zzayl.zzc(Unknown Source:27)
        at com.google.android.gms.internal.ads.zzn.processRequest(Unknown Source:28)
        at com.google.android.gms.internal.ads.zzn.run(Unknown Source:12)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/base.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_dependencies_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_resources_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_0_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_1_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_2_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_3_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_4_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_5_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_6_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_7_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_8_apk.apk", zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/lib/arm64, /system/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 com.google.android.gms.internal.ads.zzaj.zzb(Unknown Source:3) 
        at com.google.android.gms.internal.ads.zzai.zza(Unknown Source:4) 
        at com.google.android.gms.internal.ads.zzak.zzc(Unknown Source:32) 
        at com.google.android.gms.internal.ads.zzayl.zzc(Unknown Source:27) 
        at com.google.android.gms.internal.ads.zzn.processRequest(Unknown Source:28) 
        at com.google.android.gms.internal.ads.zzn.run(Unknown Source:12) 
        Suppressed: java.io.IOException: No original dex files found for dex location /data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/split_lib_resources_apk.apk
        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:2345)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5798)
        at android.app.ActivityThread.access$1100(ActivityThread.java:200)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6718)
        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)
Application terminated.

3 个答案:

答案 0 :(得分:0)

您未在清单文件中定义您的班级。这就是为什么会出错。

因此,首先检查清单文件并确认。

答案 1 :(得分:0)

<application>标签内的<application android:theme="@style/AppTheme"> <uses-library android:name="org.apache.http.legacy" android:required="false" /> </application> 中添加它

"avg"

答案 2 :(得分:0)

您得到NoClassDefError

java.lang.NoClassDefFoundError: Failed resolution of:
                          Lorg/apache/http/ProtocolVersion;

引起
java.lang.ClassNotFoundException:  

因为Dalvik可执行文件(Dex)类加载器找不到运行时的特定类 :

Didn't find class: "org.apache.http.ProtocolVersion"

当它尝试运行您的应用时

on path: DexPathList[[zip file "/data/app/my.zen.com.uselessapp.xxxxxxxx-CoQm7REaeOORs9mK5raYJw==/base.apk",

基本上就是这个意思。因此,请检查可以在哪里使用该类,我怀疑您的依赖项之一,并确保一切正常,然后尝试再次构建。