“Unable to get provider com.google.firebase.provider.FirebaseInitProvider” Error path Android

后端 未结 6 881
死守一世寂寞
死守一世寂寞 2020-12-15 17:06

I have an Application which is connected to firebase.The problem is when install the app in device(working on several devices).I read a lot of forums and no one works.I read

6条回答
  •  醉梦人生
    2020-12-15 17:35

    I have also faced same problem with Firebase when run application below API 19(< 4.4.2) devices due to error of Multidex. Then below solution work for me:

    In app module build.gradle

    android {
       ...
       defaultConfig {
           multiDexEnabled true
           ...
       }
    }
    
    dependencies {
      // add dependency 
      compile 'com.android.support:multidex:1.0.1'
    }
    
    // ADD THIS AT THE BOTTOM
    apply plugin: 'com.google.gms.google-services'
    

    update name in AndroidManifest.xml

    
    
         // ...
    
    

    Crate a MyApplication.java file

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

提交回复
热议问题