在路径DexPathList上找不到类 [英] Didn't find class on path DexPathList

查看:495
本文介绍了在路径DexPathList上找不到类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将我的项目更新为targetSdk 23,但鉴于所有弃用的内容,我认为我不满意。我不想经历它,所以我恢复到了较旧的版本,现在我得到的只是这个错误,我无法让该死的应用程序再次运行。可能出什么问题了?

I was attempting to update my project to targetSdk 23, but I decided I wasn't up for it given all the deprecations. I didn't want to go through it so I reverted to an older version on mercurial, and now all I get is this error and I can't get the damn app to run again. What could possibly be going wrong?

12-21 02:36:00.545      437-437/com.elgami.customizer E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.elgami.customizer, PID: 437
    java.lang.RuntimeException: Unable to instantiate application com.elgami.application.GlobalApplication: java.lang.ClassNotFoundException: Didn't find class "com.elgami.application.GlobalApplication" on path: DexPathList[[zip file "/data/app/com.elgami.customizer-1/base.apk"],nativeLibraryDirectories=[/data/app/com.elgami.customizer-1/lib/arm, /vendor/lib, /system/lib]]
            at android.app.LoadedApk.makeApplication(LoadedApk.java:578)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4680)
            at android.app.ActivityThread.-wrap1(ActivityThread.java)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:148)
            at android.app.ActivityThread.main(ActivityThread.java:5417)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.elgami.application.GlobalApplication" on path: DexPathList[[zip file "/data/app/com.elgami.customizer-1/base.apk"],nativeLibraryDirectories=[/data/app/com.elgami.customizer-1/lib/arm, /vendor/lib, /system/lib]]
            at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
            at android.app.Instrumentation.newApplication(Instrumentation.java:981)
            at android.app.LoadedApk.makeApplication(LoadedApk.java:573)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4680)
            at android.app.ActivityThread.-wrap1(ActivityThread.java)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:148)
            at android.app.ActivityThread.main(ActivityThread.java:5417)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.elgami.customizer-1/base.apk
            at dalvik.system.DexFile.openDexFileNative(Native Method)
            at dalvik.system.DexFile.openDexFile(DexFile.java:295)
            at dalvik.system.DexFile.<init>(DexFile.java:80)
            at dalvik.system.DexFile.<init>(DexFile.java:59)
            at dalvik.system.DexPathList.loadDexFile(DexPathList.java:279)
            at dalvik.system.DexPathList.makePathElements(DexPathList.java:248)
            at dalvik.system.DexPathList.<init>(DexPathList.java:120)
            at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
            at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:65)
            at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
            at android.app.LoadedApk.getClassLoader(LoadedApk.java:376)
            at android.app.LoadedApk.makeApplication(LoadedApk.java:568)
            ... 9 more
    Suppressed: java.lang.ClassNotFoundException: com.elgami.application.GlobalApplication
            at java.lang.Class.classForName(Native Method)
            at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
            at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
            ... 12 more
     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

我的构建文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Google Inc.:Google APIs:21'
    buildToolsVersion '21.1.2'

    defaultConfig {
        applicationId "com.elgami.customizer"
        minSdkVersion 14
        targetSdkVersion 21
    }

    buildTypes {
        release {
            minifyEnabled false
            //runProguard false
            //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.ogaclejapan.smarttablayout:library:1.5.0@aar'
    compile 'com.github.antonyt:InfiniteViewPager:v1.0.0'
    compile 'com.android.support:appcompat-v7:22.2.0'
    // recyclerview
    compile 'com.android.support:recyclerview-v7:23.1.1'
    // google analytics
    compile 'com.google.android.gms:play-services-analytics:8.3.0'
    // pager sliding strip
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    // http library (for using beanstream REST)
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
    // amaazon S3 uploads
    compile 'com.amazonaws:aws-android-sdk-s3:2.1.+'
    // paypal purchasing
    compile files('libs/PayPalAndroidSDK-2.7.1.jar')
    // Module dependency on ParseLoginUI library sources
    compile project(':ParseLoginUI')
    // Parse libs
    compile files('libs/ParseCrashReporting-1.9.2.jar')
    compile files('libs/Parse-1.9.1.jar')
    compile files('libs/ParseFacebookUtilsV4-1.9.1.jar')
    // android support v4
    compile files('libs/android-support-v4.jar')
    // facebook SDK
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'
    //butterknife
    compile 'com.jakewharton:butterknife:6.1.0'
    // Subsampling-scale-image-view (for templating)
    //compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.1.4'
    compile files('libs/AppRater.jar')
}


推荐答案


Android应用程序(APK)文件包含Dalvik可执行文件(DEX)文件形式的
可执行字节代码文件,其中包含用于运行应用程序的已编译
代码。 Dalvik Executable规范将
限制在单个DEX
文件中可以引用的方法总数限制为65,536,包括Android框架方法,库方法,
和您自己代码中的方法。超过此限制要求将应用程序构建过程中的
配置为生成多个DEX
文件,称为multidex配置。

Android application (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536, including Android framework methods, library methods, and methods in your own code. Getting past this limit requires that you configure your app build process to generate more than one DEX file, known as a multidex configuration.




  1. 更改您的Gradle构建配置以启用multidex

  2. 修改清单以引用MultiDexApplication class

  1. Change your Gradle build configuration to enable multidex
  2. Modify your manifest to reference the MultiDexApplication class

修改您的应用Gradle构建文件配置,以包括支持库并启用multidex输出。 em>

Modify your app Gradle build file configuration to include the support library and enable multidex output .

    android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        ...
        minSdkVersion 14
        targetSdkVersion 21
        ...

        // Enabling multidex support.
        multiDexEnabled true
    }
    ...
}

dependencies {
  compile 'com.android.support:multidex:1.0.0'
}

有关更多详细信息,请访问

For more details you can visit


DexIndexOverflowException仅在运行测试时

这篇关于在路径DexPathList上找不到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆