Didn't find class “com.google.firebase.provider.FirebaseInitProvider”

前端 未结 9 1334
感动是毒
感动是毒 2021-02-14 06:05

Before, my program run well. But When I just updated my Android studio to the latest version (2.2 built on 15-sept-16), I am having the following error. When I built it, it says

相关标签:
9条回答
  • 2021-02-14 06:46

    In app module build.gradle

    android {
       ...
       defaultConfig {
          multiDexEnabled true
          ...
       }
    }
    
    dependencies {
      // add dependency 
      compile 'com.android.support:multidex:1.0.1'
    }
    

    Change name in AndroidManifest.xml

    <application
       ....
      android:name=".MyApplication">
    
     // ...
    </application>
    

    Crate a MyApplication.java file

    public class MyApplication extends Application {
    
        @Override
        protected void attachBaseContext(Context base) {
            super.attachBaseContext(base);
            MultiDex.install(this);
        }
    
    }
    

    For MORE details can see this link.

    0 讨论(0)
  • 2021-02-14 06:46

    just remove the google play services dependencies if you are including it. I am able to fix this error everytime using this. If you are using google maps or any other specific google service then include the dependency for that particular service only. Also try to check the version of google play service dependency.

    0 讨论(0)
  • 2021-02-14 06:48

    app=>build.gradle

    android {
    .....
    defaultConfig {
    ......
     multiDexEnabled true//add this line
    }
    ......
    dependencies{
     compile 'com.android.support:multidex:1.0.1'//add this line
    }
    

    In manifest

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    ....
    <application
    ....
     android:name="android.support.multidex.MultiDexApplication" 
    ...>
     <activity   />
    ...
    
    </application>
    
    </manifest>
    
    0 讨论(0)
提交回复
热议问题