1

FirebaseStorage.getInstance().getReference() crashes the app. I have checked another similar post but that did not help as my google-services.json file is correctly downloaded from FireBase API and the FireBase assistant shows connection and status as 'OK'.

here's the log:

  A/FirebaseApp: 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:1737)
  at android.content.ContentProvider.attachInfo(ContentProvider.java:1712)
  at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
  at android.app.ActivityThread.installProvider(ActivityThread.java:6487)
  at android.app.ActivityThread.installContentProviders(ActivityThread.java:6082)
  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6022)
  at android.app.ActivityThread.access$1700(ActivityThread.java:211)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1766)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:145)
  at android.app.ActivityThread.main(ActivityThread.java:6946)
  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:1404)
  at com.android.internal .os.ZygoteInit.main(ZygoteInit.java:1199)
  Caused by: java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzx; or its super classes (declaration of 'com.google.android.gms.common.util.zzx' appears in /data /data /com.example.bhrigu.simpleblog/files/instant-run/dex/slice-com.google.android.gms-play-services-basement-10.0.0_c06534ef2c8c0d287af412696f22ee66b12bcbfa-classes.dex)
  at com.google.firebase.iid.zzg.zzkg(Unknown Source)
Kasım Özdemir
  • 5,414
  • 3
  • 18
  • 35
Bhrigu
  • 88
  • 10
  • post your code in question.. – Muhammad Waleed Dec 03 '16 at 09:42
  • did you try this answer?? http://stackoverflow.com/a/37551156/3678308 – Muhammad Waleed Dec 03 '16 at 09:43
  • What version of Google Play Services are you using? Seems to be an issue with that: `Caused by: java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzx; or its super classes (declaration of 'com.google.android.gms.common.util.zzx' appears in /data/data/com.example.bhrigu.simpleblog/files/instant-run/dex/slice-com.google.android.gms-play-services-basement-10.0.0_c06534ef2c8c0d287af412696f22ee66b12bcbfa-classes.dex)`. I assume 10.0.0 given the info there? – Mike McDonald Dec 05 '16 at 00:23
  • Also, this isn't an issue with `Storage`, it appears to be an issue with the Firebase initialization process and the new Google Play Services. – Mike McDonald Dec 05 '16 at 00:24
  • Try updating Play Services. You can do this: Go to Settings, Google Settings > overflow menu > Help & Feedback > overflow menu > View in Google Play Store > Update – Benjamin Wulfe Dec 05 '16 at 01:15
  • 1
    Thanks. There was indeed a conflict with the google-play version. Initially, I had used version 9.2.0 for Firebase libraries as I was getting errors with 10.0.0. However fixing the google-play version seems to have taken care of those ones as well. And I am able to run with all the updated libraries. – Bhrigu Dec 05 '16 at 22:24

1 Answers1

0

There was indeed a conflict with the google-play version. Initially, I had used version 9.2.0 for Firebase libraries as I was getting errors with 10.0.0. However fixing the google-play version seems to have taken care of those ones as well. And I am able to run with all the updated libraries.

Bhrigu
  • 88
  • 10