java.lang.Classnotfoundexception: Didn’t find class "com.google.firebase.provider.Firebaseinitprovider" on path: Dexpathlist

Asked

Viewed 845 times

0

Good evening. Does anyone know how to solve this problem ?

11-14 17:40:57.910 2110-2110/? E/AndroidRuntime: FATAL EXCEPTION: main
                                             Process: br.com.appvis.appvis, PID: 2110
                                             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/br.com.appvis.appvis-2.apk"],nativeLibraryDirectories=[/data/app-lib/br.com.appvis.appvis-2, /system/lib]]
                                                 at android.app.ActivityThread.installProvider(ActivityThread.java:4793)
                                                 at android.app.ActivityThread.installContentProviders(ActivityThread.java:4385)
                                                 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325)
                                                 at android.app.ActivityThread.access$1500(ActivityThread.java:135)
                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                 at android.os.Looper.loop(Looper.java:136)
                                                 at android.app.ActivityThread.main(ActivityThread.java:5017)
                                                 at java.lang.reflect.Method.invokeNative(Native Method)
                                                 at java.lang.reflect.Method.invoke(Method.java:515)
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
                                                 at dalvik.system.NativeStart.main(Native Method)
                                              Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/br.com.appvis.appvis-2.apk"],nativeLibraryDirectories=[/data/app-lib/br.com.appvis.appvis-2, /system/lib]]
                                                 at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
                                                 at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
                                                 at android.app.ActivityThread.installProvider(ActivityThread.java:4778)
                                                 at android.app.ActivityThread.installContentProviders(ActivityThread.java:4385) 
                                                 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325) 
                                                 at android.app.ActivityThread.access$1500(ActivityThread.java:135) 
                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 
                                                 at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                 at android.os.Looper.loop(Looper.java:136) 
                                                 at android.app.ActivityThread.main(ActivityThread.java:5017) 
                                                 at java.lang.reflect.Method.invokeNative(Native Method) 
                                                 at java.lang.reflect.Method.invoke(Method.java:515) 
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
                                                 at dalvik.system.NativeStart.main(Native Method) 

This error happens with some versions of Android. I tested with Android 6.0 and Android 5.0 and did not give error. However I went to test with Kit Kat and some cell phones of the Moto G1 gave error.

Look at the build. Gradle

apply plugin: 'com.android.application'

android { compileSdkVersion 24 buildToolsVersion "24.0.1"

defaultConfig {
    applicationId "br.com.appvis.appvis"
    minSdkVersion 16
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies {

testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.google.firebase:firebase-ads:9.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:multidex:1.0.1'
compile 'org.parceler:parceler:1.0.3'
compile 'org.parceler:parceler-api:1.0.3'
compile 'br.com.livroandroid:android-utils:1.0.5'

}

  • See if there’s a help response: http://answall.com/a/157946/35406

1 answer

1

I saw that you have already enabled Multidex, so to complement, you should create a class and make a extends in class Application package android app. and call the install method of the Multidex class by passing its context.

public class MyApplication extends Application {

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}

Done that, go to the Androidmanifest.xml and change or insert the following line:

<application
        android:allowBackup="true"
        android:name=".MyApplication" <-- Classe criada aqui -->
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
...
</application>

From the outbuildings, I saw that you appear to be using the lecheta book, right?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.