在使targetSdkVersion 27获得BaseDexClassLoader.java:56之后

时间:2018-08-27 14:01:17

标签: android android-multidex

我的targetSdkVersion是23,当我27岁时,我的实时应用程序报告BaseDexClassLoader.java:56崩溃了1000次。当我恢复为targetSdkVersion 23时,没有崩溃报告。

  

java.lang.RuntimeException:    在android.app.ActivityThread.handleReceiver(ActivityThread.java:3343)    在android.app.ActivityThread.-wrap20(ActivityThread.java)    在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1726)    在android.os.Handler.dispatchMessage(Handler.java:102)    在android.os.Looper.loop(Looper.java:154)    在android.app.ActivityThread.main(ActivityThread.java:6776)    在java.lang.reflect.Method.invoke(本机方法)    在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1518)    在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)   造成原因:java.lang.ClassNotFoundException:    在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)    在java.lang.ClassLoader.loadClass(ClassLoader.java:380)    在java.lang.ClassLoader.loadClass(ClassLoader.java:312)    在android.app.ActivityThread.handleReceiver(ActivityThread.java:3338)

我的app.gradle

    apply plugin: 'com.android.application'
repositories {
    mavenCentral()
    maven() { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
android {
    compileSdkVersion 27
    buildToolsVersion '28.0.1'

    defaultConfig {
        applicationId "com.test.text"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 2
        versionName "2.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            //multiDexKeepFile file('multidex-config.txt')
            multiDexEnabled true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    dexOptions {
        incremental true
        javaMaxHeapSize "4g"
    }

}
configurations {
    all*.exclude group: 'com.android.support', module: 'support-v13'
}
dependencies {
    api 'com.github.yukuku:ambilwarna:2.0.1'
    api project(':multipicker')
    api project(':fonts')
    api 'com.github.mancj:SlideUp-Android:2.2.7.1'
    api('com.github.worker8:tourguide:1.0.17-SNAPSHOT@aar') {
        transitive = true
    }
    api project(':library')
    api 'com.facebook.android:audience-network-sdk:4.28.2'
    api 'com.google.ads.mediation:facebook:4.28.2.0'
    api 'com.squareup.picasso:picasso:2.5.2'
    api 'com.squareup.retrofit2:retrofit:2.3.0'
    api 'com.squareup.retrofit2:converter-gson:2.3.0'
    api 'com.github.bumptech.glide:glide:3.6.1'
    api 'com.afollestad.material-dialogs:commons:0.9.4.5'
    api 'com.android.support:multidex:1.0.3'
    api project(':template-libraryversion2')
    api 'com.github.ybq:Android-SpinKit:1.1.0'
    api supportDependencies.appCompat
    api supportDependencies.design
    api supportDependencies.cardview

    //fcm
    api 'com.google.firebase:firebase-core:16.0.1'
    api 'com.google.firebase:firebase-messaging:17.3.0'
    api 'com.squareup.picasso:picasso:2.5.2'
    //fcm end
}
apply plugin: 'com.google.gms.google-services'

0 个答案:

没有答案