Didn't used firebase in my project but still throws Firebase API initialization failure

747 views Asked by At

I didn't used Firebase in my Android project, even didn't have any code related to Firebase but my app throws a fatal error like below. Please Guide.

Firebase API initialization failure

java.lang.reflect.InvocationTargetException
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at com.google.firebase.FirebaseApp.zza(Unknown Source)
     at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
     at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
     at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
     at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
     at android.content.ContentProvider.attachInfo(ContentProvider.java:1750)
     at android.content.ContentProvider.attachInfo(ContentProvider.java:1719)
     at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
     at android.app.ActivityThread.installProvider(ActivityThread.java:5229)
     at android.app.ActivityThread.installContentProviders(ActivityThread.java:4803)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4743)
     at android.app.ActivityThread.access$1500(ActivityThread.java:169)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1484)
     at android.os.Handler.dispatchMessage(Handler.java:111)
     at android.os.Looper.loop(Looper.java:194)
     at android.app.ActivityThread.main(ActivityThread.java:5546)
     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:967)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
  Caused by: java.lang.IllegalArgumentException: Given String is empty or null
     at com.google.android.gms.common.internal.zzac.zzhz(Unknown Source)
     at com.google.android.gms.internal.zzagt$zza$zza.<init>(Unknown Source)
     at com.google.firebase.auth.FirebaseAuth.zzb(Unknown Source)
     at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
     at com.google.android.gms.internal.zzahe.<init>(Unknown Source)
     at com.google.firebase.auth.FirebaseAuth.zzd(Unknown Source)
     at com.google.firebase.auth.FirebaseAuth.zzc(Unknown Source)
     at com.google.firebase.auth.FirebaseAuth.getInstance(Unknown Source)
     at java.lang.reflect.Method.invoke(Native Method) 
     at java.lang.reflect.Method.invoke(Method.java:372) 
     at com.google.firebase.FirebaseApp.zza(Unknown Source) 
     at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
     at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
     at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
     at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) 
     at android.content.ContentProvider.attachInfo(ContentProvider.java:1750) 
     at android.content.ContentProvider.attachInfo(ContentProvider.java:1719) 
     at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
     at android.app.ActivityThread.installProvider(ActivityThread.java:5229) 
     at android.app.ActivityThread.installContentProviders(ActivityThread.java:4803) 
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4743) 
     at android.app.ActivityThread.access$1500(ActivityThread.java:169) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1484) 
     at android.os.Handler.dispatchMessage(Handler.java:111) 
     at android.os.Looper.loop(Looper.java:194) 
     at android.app.ActivityThread.main(ActivityThread.java:5546) 
     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:967) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

Failed to initialize crash reporting

java.lang.RuntimeException: Missing an expected resource: 'R.string.google_api_key' for initializing Google services.  Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
   at bmh.b(:com.google.android.gms.DynamiteModulesC:30)
   at com.google.firebase.crash.internal.api.FirebaseCrashApiImpl.init(:com.google.android.gms.DynamiteModulesC:70)
   at bky.onTransact(:com.google.android.gms.DynamiteModulesC:60)
   at android.os.Binder.transact(Binder.java:385)
   at com.google.firebase.crash.internal.zzd$zza$zza.zza(Unknown Source)
   at com.google.firebase.crash.FirebaseCrash.<init>(Unknown Source)
   at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
   at java.lang.reflect.Method.invoke(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.google.firebase.FirebaseApp.zza(Unknown Source)
   at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
   at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
   at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
   at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
   at android.content.ContentProvider.attachInfo(ContentProvider.java:1750)
   at android.content.ContentProvider.attachInfo(ContentProvider.java:1719)
   at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
   at android.app.ActivityThread.installProvider(ActivityThread.java:5229)
   at android.app.ActivityThread.installContentProviders(ActivityThread.java:4803)
   at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4743)
   at android.app.ActivityThread.access$1500(ActivityThread.java:169)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1484)
   at android.os.Handler.dispatchMessage(Handler.java:111)
   at android.os.Looper.loop(Looper.java:194)
   at android.app.ActivityThread.main(ActivityThread.java:5546)
   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:967)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

I really not want to import Firebase just to know FATAL errors got when code.

Dependencies:

dependencies {
    compile project(':braintreePaymentLibrary')
    compile 'com.google.android.gms:play-services:9.6.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.squareup.okhttp:okhttp:2.4.0'
    //    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile fileTree(include: '*.jar', dir: 'libs')
    compile 'com.thrivecom:ringcaptcha:1.0.8@aar'
    compile files('libs/YouTubeAndroidPlayerApi.jar')
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile files('libs/fastjson-1.1.33.android.jar')
    compile 'com.github.clans:fab:1.6.3'
    compile 'com.github.eluleci:flatui:3.0.0'
    compile 'com.android.support:support-v4:23.+'
    compile 'com.daimajia.swipelayout:library:1.2.0@aar'
    compile('com.crashlytics.sdk.android:crashlytics:2.5.6@aar') {
        transitive = true;
    }
    compile project(':mcalendarview')
    compile 'me.everything:overscroll-decor-android:1.0.3'
    compile 'com.jaredrummler:material-spinner:1.1.0'
    compile files('libs/httpmime-4.3.6.jar')
    compile files('libs/httpcore-4.3.3.jar')
    compile files('libs/httpclient-4.3.6.jar')
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
}

1

There are 1 answers

0
Bob Snyder On BEST ANSWER

This dependency includes ALL of the Play Services APIs, including Firebase:

compile 'com.google.android.gms:play-services:9.6.0'

Replace that dependency with the specific Play Services APIs you need. They are listed in Table 1 of the Play Services Setup Guide.