在路径上找不到“com.google.firebase.provider.FirebaseInitProvider”类:DexPathList

时间:2018-03-08 04:09:55

标签: android firebase

我不知道为什么会崩溃我的代码: -

我正在使用Firebase并出现一些错误。

Logcats: -

java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.mstuv.android-2/base.apk", zip file "/data/app/com.mstuv.android-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
     at android.app.ActivityThread.installProvider(ActivityThread.java:5562)
     at android.app.ActivityThread.installContentProviders(ActivityThread.java:5154)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5094)
     at android.app.ActivityThread.access$1600(ActivityThread.java:177)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1509)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:145)
     at android.app.ActivityThread.main(ActivityThread.java:5942)
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
  Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.mstuv.android-2/base.apk", zip file "/data/app/com.mstuv.android-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.mstuv.android-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/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.ActivityThread.installProvider(ActivityThread.java:5547)
     at android.app.ActivityThread.installContentProviders(ActivityThread.java:5154) 
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5094) 
     at android.app.ActivityThread.access$1600(ActivityThread.java:177) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1509) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:145) 
     at android.app.ActivityThread.main(ActivityThread.java:5942) 
     at java.lang.reflect.Method.invoke(Native Method) 
     at java.lang.reflect.Method.invoke(Method.java:372) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) 
    Suppressed: java.lang.ClassNotFoundException: com.google.firebase.provider.FirebaseInitProvider
     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)
            ... 13 more
  Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

Gradle文件: -

buildscript {
repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'

repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
}


android {
signingConfigs {
    config {
        ...
    }
}
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
    applicationId "~~~~~~~~~~~~~~~~~"
    minSdkVersion 21
    targetSdkVersion 23
    multiDexEnabled true
}
aaptOptions {
    cruncherEnabled = false
    useNewCruncher = false
}
lintOptions {
    checkReleaseBuilds false
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
    .............
}
splits {
    abi {
        enable true
        reset()
        include 'armeabi-v7a'
    }
}
dataBinding {
    enabled = true
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:multidex:1.0.1'
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:support-v13:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:support-annotations:24.2.0'
compile 'com.google.apis:google-api-services-people:v1-rev139-1.22.0'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'com.github.bumptech.glide:glide:3.8.0'
compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
    transitive = true;
}
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.28.0'
compile 'com.facebook.android:audience-network-sdk:4.26.0'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.facebook.stetho:stetho:1.5.0'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
compile 'gun0912.ted:tedpermission:1.0.3'
compile 'com.github.HaarigerHarald:android-youtubeExtractor:master-SNAPSHOT'
compile files('libs/YouTubeAndroidPlayerApi.jar')
}

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

0 个答案:

没有答案