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

后端 未结 6 882
死守一世寂寞
死守一世寂寞 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:26

    In AndroidStudio try to do this:

    1. ctrl+alt+s
    2. Click on "Build, Execution, Deployment
    3. disable "Instant Run"

    This should work

    0 讨论(0)
  • 2020-12-15 17:28

    Disabling instant run fixed the issue for me.

    Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run

    -Uncheck the box next to "Enable Instant Run..."

    -Click OK

    0 讨论(0)
  • 2020-12-15 17:30

    If you have recently changed the firebase dependency version in your gradle you may need to update to the latest version of Google Repository in the Android SDK manager as well.

    If you cannot update the Google Repository at the time, try changing the gradle dependency version back to lower.

    0 讨论(0)
  • 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

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

    Crate a MyApplication.java file

    public class MyApplication extends Application {
    
        @Override
        protected void attachBaseContext(Context base) {
           super.attachBaseContext(base);
           MultiDex.install(this);
        }
    
    }
    
    0 讨论(0)
  • 2020-12-15 17:39

    Just insert below lines in your project AndroidManifest.xml file, if they're not in application tag

    <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
    
    0 讨论(0)
  • 2020-12-15 17:41

    I'm having the same issue, what i did is uninstall the app from device/emulator, and then, reinstall it again (from Android Studio, 'run' button).

    0 讨论(0)
提交回复
热议问题