title: Firebase API initialization failure,java.lang.reflect.InvocationTargetException
body: <p>I am using firebase auth, database and storage services in my app. It was working fine previously. I have added firebase cloud messaging setup as described in docs. But app crashes at runtime.I investigated the issue for about 4 hours and tried different solutions. Like keeping all libs version same, changing appcompat library version and change app to multidex.But nothing helped. Below is my gradle dependencies:</p>
  
  <pre><code>compile('com.digits.sdk.android:digits:2.0.6@aar') {
      transitive = true;
  }
  
  compile 'com.android.support:appcompat-v7:25.3.1'
  compile 'com.android.support.constraint:constraint-layout:1.0.2'
  compile 'com.android.support:design:25.3.1'
  compile 'com.android.support:percent:25.3.1'
  compile 'com.github.bumptech.glide:glide:3.7.0'
  testCompile 'junit:junit:4.12'
  
  //Firebase
  compile 'com.google.android.gms:play-services:10.0.1'
  compile 'com.google.firebase:firebase-auth:10.0.1'
  compile 'com.google.firebase:firebase-database:10.0.1'
  compile 'com.google.firebase:firebase-storage:10.0.1'
  compile 'com.google.firebase:firebase-core:10.0.1'
  compile 'com.google.firebase:firebase-messaging:10.0.1'
  compile 'com.firebaseui:firebase-ui-storage:0.6.0'
  </code></pre>
  
  <p>On compiling app produces following exception:</p>
  
  <pre><code>05-02 20:05:55.746 31927-31927/com.apponative.committeeapp A/FirebaseApp: Firebase API initialization failure.
    java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        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:1656)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1627)
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
        at android.app.ActivityThread.installProvider(ActivityThread.java:5015)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4589)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522)
        at android.app.ActivityThread.access$1500(ActivityThread.java:151)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
        at android.os.Handler.dispatchMessage(Handler.java:110)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:5299)
        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:829)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
        at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NoSuchMethodError: com.google.android.gms.common.api.zzc.&lt;init&gt;
        at com.google.android.gms.internal.zzbiu.&lt;init&gt;(Unknown Source)
        at com.google.android.gms.internal.zzbjc.zza(Unknown Source)
        at com.google.firebase.auth.FirebaseAuth.zzb(Unknown Source)
        at com.google.firebase.auth.FirebaseAuth.&lt;init&gt;(Unknown Source)
        at com.google.android.gms.internal.zzbkg.&lt;init&gt;(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.invokeNative(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:515) 
        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:1656) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1627) 
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
        at android.app.ActivityThread.installProvider(ActivityThread.java:5015) 
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4589) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522) 
        at android.app.ActivityThread.access$1500(ActivityThread.java:151) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381) 
        at android.os.Handler.dispatchMessage(Handler.java:110) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:5299) 
        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:829) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645) 
        at dalvik.system.NativeStart.main(Native Method) 
  05-02 20:05:55.774 31927-31927/com.apponative.committeeapp A/FirebaseApp: Firebase API initialization failure.
    java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        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:1656)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1627)
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
        at android.app.ActivityThread.installProvider(ActivityThread.java:5015)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4589)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522)
        at android.app.ActivityThread.access$1500(ActivityThread.java:151)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
        at android.os.Handler.dispatchMessage(Handler.java:110)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:5299)
        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:829)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
        at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NoSuchMethodError: com.google.android.gms.common.util.zzx.getNoBackupFilesDir
        at com.google.firebase.iid.zzh.zzeG(Unknown Source)
        at com.google.firebase.iid.zzh.&lt;init&gt;(Unknown Source)
        at com.google.firebase.iid.zzh.&lt;init&gt;(Unknown Source)
        at com.google.firebase.iid.zzd.zzb(Unknown Source)
        at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
        at java.lang.reflect.Method.invokeNative(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:515) 
        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:1656) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1627) 
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
        at android.app.ActivityThread.installProvider(ActivityThread.java:5015) 
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4589) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522) 
        at android.app.ActivityThread.access$1500(ActivityThread.java:151) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381) 
        at android.os.Handler.dispatchMessage(Handler.java:110) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:5299) 
        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:829) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645) 
        at dalvik.system.NativeStart.main(Native Method) 
  05-02 20:05:55.818 31927-31927/com.apponative.committeeapp A/FirebaseApp: Firebase API initialization failure.
    java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        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:1656)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1627)
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
        at android.app.ActivityThread.installProvider(ActivityThread.java:5015)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4589)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522)
        at android.app.ActivityThread.access$1500(ActivityThread.java:151)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
        at android.os.Handler.dispatchMessage(Handler.java:110)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:5299)
        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:829)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
        at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NoSuchMethodError: com.google.android.gms.internal.zzapn.zzb
        at com.google.android.gms.internal.zzbku.&lt;clinit&gt;(Unknown Source)
        at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
        at java.lang.reflect.Method.invokeNative(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:515) 
        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:1656) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1627) 
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
        at android.app.ActivityThread.installProvider(ActivityThread.java:5015) 
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4589) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522) 
        at android.app.ActivityThread.access$1500(ActivityThread.java:151) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381) 
        at android.os.Handler.dispatchMessage(Handler.java:110) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:5299) 
        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:829) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)   at dalvik.system.NativeStart.main(Native Method) 
  05-02 20:05:55.845 31927-31927/com.apponative.committeeapp A/FirebaseApp: Firebase API initialization failure.
    java.lang.reflect.InvocationTargetException  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  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:1656)  at android.content.ContentProvider.attachInfo(ContentProvider.java:1627)   at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)  at android.app.ActivityThread.installProvider(ActivityThread.java:5015)  at android.app.ActivityThread.installContentProviders(ActivityThread.java:4589)at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522)  at android.app.ActivityThread.access$1500(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)  at android.os.Handler.dispatchMessage(Handler.java:110)  at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5299)  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:829)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645) at dalvik.system.NativeStart.main(Native Method)
  Caused by: java.lang.VerifyError: com/google/android/gms/internal/zzatp at com.google.android.gms.measurement.AppMeasurement.getInstance(Unknown Source) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515)  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:1656)  at android.content.ContentProvider.attachInfo(ContentProvider.java:1627)  at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:5015)  at android.app.ActivityThread.installContentProviders(ActivityThread.java:4589)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4522)  at android.app.ActivityThread.access$1500(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381) at android.os.Handler.dispatchMessage(Handler.java:110)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:5299) 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:829) 
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645) 
        at dalvik.system.NativeStart.main(Native Method) 
  05-02 20:05:56.468 31927-31927/com.apponative.committeeapp E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
  05-02 20:05:56.842 31927-31927/com.apponative.committeeapp E/AndroidRuntime: FATAL EXCEPTION: main
       Process: com.apponative.committeeapp, PID: 31927
       java.lang.NoSuchMethodError: com.google.android.gms.common.api.zzc.&lt;init&gt;       at com.google.android.gms.internal.zzbiu.&lt;init&gt;(Unknown Source)                at com.google.android.gms.internal.zzbjc.zza(Unknown Source)                  at com.google.firebase.auth.FirebaseAuth.zzb(Unknown Source)                 at com.google.firebase.auth.FirebaseAuth.&lt;init&gt;(Unknown Source)               at com.google.android.gms.internal.zzbkg.&lt;init&gt;(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 com.apponative.committeeapp.firebase.FireBaseAuth.fireBaseAuth(FireBaseAuth.java:42)             
  </code></pre>