当前位置: 首页 > 知识库问答 >
问题:

java.lang.ClassNotFoundException:在路径:DexPathList上没有找到class.Application

束敏学
2023-03-14
public class Application extends android.app.Application{
    @Override
    public void onCreate() {
        super.onCreate();
        Firebase.setAndroidContext(this);
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}
multiDexEnabled true
    compile 'com.android.support:multidex:1.0.1'
apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.3"

    defaultConfig {
        applicationId "pakage.com"
        minSdkVersion 17
        targetSdkVersion 24
        versionCode 18
        versionName "18"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"


        jackOptions {
            enabled true
            additionalParameters('jack.incremental': 'true')
        }
    }

    compileOptions {
        incremental true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    dexOptions {
        preDexLibraries = false
        javaMaxHeapSize '4096m'
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }



    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
    }




}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.firebase:firebase-client-android:2.3.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.android.support:recyclerview-v7:24.2.1'
    compile 'com.android.support:cardview-v7:24.2.1'
    compile 'com.squareup.picasso:picasso:2.5.0'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.google.android.gms:play-services-ads:9.8.0'
    compile 'com.google.firebase:firebase-messaging:9.8.0'
    compile 'com.google.firebase:firebase-auth:9.8.0'
    compile 'com.google.android.gms:play-services:9.8.0'
    compile 'com.google.firebase:firebase-core:9.8.0'
    compile 'com.google.firebase:firebase-database:9.8.0'
    compile 'com.android.support:multidex:1.0.1'
    testCompile 'junit:junit:4.12'
    compile 'com.google.android:support-v4:r7'
}


apply plugin: 'com.google.gms.google-services'

提示/否这里的任何解决方案都是解决我:

请帮帮我

暂时还没有答案

 类似资料: