FirebaseStorage.getInstance().getReference() crashes app - android

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)

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.

Related

Ionic Android RuntimeException FirebaseInitProvider IllegalArgumentException: Given String is empty or null

Project build using Ionic. After generating Android build and import in Android SDK.
It gives error while running app in device/simulator. Also using FCM for push notifications.
Android runtime error after installing APK:
--------- beginning of crash
2018-05-04 16:34:30.077 14810-14810/com.app.name E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.name, PID: 14810
java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalArgumentException: Given String is empty or null
at android.app.ActivityThread.installProvider(ActivityThread.java:5856)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.IllegalArgumentException: Given String is empty or null
at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source)
at com.google.firebase.auth.api.internal.zzcq.<init>(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
at com.google.firebase.auth.internal.zzj.<init>(Unknown Source)
at com.google.firebase.auth.zzo.create(Unknown Source)
at com.google.firebase.components.zzi.zza(Unknown Source)
at com.google.firebase.components.zzj.get(Unknown Source)
at com.google.firebase.components.zzi.get(Unknown Source)
at com.google.firebase.components.ComponentContainer$$CC.get(Unknown Source)
at com.google.firebase.components.zzg.get(Unknown Source)
at com.google.firebase.components.zzg.zzb(Unknown Source)
at com.google.firebase.FirebaseApp.zzc(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:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384) 
at android.app.ActivityThread.-wrap2(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6119) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
Is there a problem with my configuration or is something missing while processing Android build?
I also had same issue and solved that problem now.
In my case, empty, or null value is "current_key" value in google-services.jsonso I fill the value (web API key) found in the Firebase console

App not running after adding firebase

I've added firebase-core to my project for analytics but since then my app is not responding.
This is the class path for gms that I'm using :
classpath 'com.google.gms:google-services:3.1.0'
This is the dependency that I'm using for firebase :
compile 'com.google.firebase:firebase-core:11.0.1'
Also I've added apply plugin: 'com.google.gms.google-services' to bottom of my build gradle file.
And in my application class I'm just initializing the FirebaseAnalytics :
firebaseAnalytics = FirebaseAnalytics.getInstance(getApplicationContext());
And this is the error I got from the logcat :
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.PHELAT.Vollip, PID: 15670
java.lang.NoClassDefFoundError: com.google.android.gms.common.api.Status
at com.google.android.gms.internal.zzbdl.<init>(Unknown Source)
at com.google.android.gms.internal.zzbdl.zzaz(Unknown Source)
at com.google.android.gms.internal.zzcff.zzjD(Unknown Source)
at com.google.android.gms.internal.zzchi.initialize(Unknown Source)
at com.google.android.gms.internal.zzcgk.<init>(Unknown Source)
at com.google.android.gms.internal.zzcgk.zzbj(Unknown Source)
at com.google.firebase.analytics.FirebaseAnalytics.getInstance(Unknown Source)
at com.PHELAT.Vollip.Vollip.onCreate(Vollip.java:84)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1025)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5548)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1576)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:241)
at android.app.ActivityThread.main(ActivityThread.java:6274)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.InstantiationError: com.google.android.gms.common.api.zzf
at com.google.android.gms.common.api.Status.<clinit>(Unknown Source)
at com.google.android.gms.internal.zzbdl.<init>(Unknown Source)
at com.google.android.gms.internal.zzbdl.zzaz(Unknown Source)
at com.google.android.gms.internal.zzcff.zzjD(Unknown Source)
at com.google.android.gms.internal.zzchi.initialize(Unknown Source)
at com.google.android.gms.internal.zzcgk.<init>(Unknown Source)
at com.google.android.gms.internal.zzcgk.zzbj(Unknown Source)
at com.google.android.gms.measurement.AppMeasurement.getInstance(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
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:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:6008)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5590)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5529)
at android.app.ActivityThread.-wrap2(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1576) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:241) 
at android.app.ActivityThread.main(ActivityThread.java:6274) 
The error is pointing to line 84 of my application class which is the FirebaseAnalytics init.
Also, I did some research on this problem and I've found out that I need to enable multidex in my project, I've enabled multidexing but nothing changed.
Something that I've noticed is after adding firebase to my project, the apk size is reduced by 1mb and now I have two .dex classes in my apk, I think firebase is multidexing my app automatically but its not configured.
EDIT :
I'm switching back to fabric, I've just noticed that firebase is not working in Iran because of sanctions.
use this version and try.
(Note: use same version for all gms and firebase library)
compile 'com.google.android.gms:play-services-maps:9.6.1'
compile 'com.google.android.gms:play-services-places:9.6.1'
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.firebase:firebase-auth:9.6.1'

DeadObjectException with stacktrace pointing to : android.app.ApplicationPackageManager.getPackageInstaller

I'm seeing in crash being reported in crashlytics which has this stack trace which has no mention of my app code.
I have seen DeadObjectException with com.google.android.gms and there, the crash was triggered when removing listeners.
Also, everytime my app starts, I get the installer for logging purposes, i.e.
packageManager.getInstallerPackageName(my-package-name)
There is no callback associated with this call.
Crash is observed mainly on Lollipop and Kitkat, though few Marshmallow and Nougat users have experienced it too.
Has anyone experienced something similar?
Fatal Exception: java.lang.RuntimeException: android.os.DeadObjectException
at android.app.ApplicationPackageManager.getPackageInstaller(ApplicationPackageManager.java:1632)
at com.google.android.gms.common.zze.zzl(Unknown Source)
at com.google.android.gms.common.GoogleApiAvailability.getInstance(Unknown Source:8000)
at com.google.android.gms.internal.zzpy.zzc(Unknown Source:24000)
at com.google.android.gms.internal.zzpv.begin(Unknown Source)
at com.google.android.gms.internal.zzqa.zzc(Unknown Source)
at com.google.android.gms.internal.zzpp.onConnectionSuspended(Unknown Source)
at com.google.android.gms.common.internal.zzk$1.onConnectionSuspended(Unknown Source)
at com.google.android.gms.common.internal.zzd$zzd.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5438)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Binder.java)
at android.os.BinderProxy.transact(Binder.java:496)
at android.content.pm.IPackageManager$Stub$Proxy.getPackageInstaller(IPackageManager.java:4229)
at android.app.ApplicationPackageManager.getPackageInstaller(ApplicationPackageManager.java:1629)
at com.google.android.gms.common.zze.zzl(Unknown Source)
at com.google.android.gms.common.GoogleApiAvailability.getInstance(Unknown Source:8000)
at com.google.android.gms.internal.zzpy.zzc(Unknown Source:24000)
at com.google.android.gms.internal.zzpv.begin(Unknown Source)
at com.google.android.gms.internal.zzqa.zzc(Unknown Source)
at com.google.android.gms.internal.zzpp.onConnectionSuspended(Unknown Source)
at com.google.android.gms.common.internal.zzk$1.onConnectionSuspended(Unknown Source)
at com.google.android.gms.common.internal.zzd$zzd.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5438)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Here are the Fabric crashlytics reason for this exception.
DeadObjectExceptions are usually a symptom of a problem occurring somewhere else (likely in a remote process). Even though this exception may be safe to catch, it's worth looking for problems in related services.
This error could mean one of two things:
1) There is a bug (which caused a crash) in an associated process.
2) The other process was killed by the OS.
Source: Fabric crashlytics report.
Resources: Here & Here

ProGuard causing Jackson error, "Conflicting property name definitions"

I am using the Nest Android SDK and am getting close to releasing my application. I have found that it is not possible to use Proguard with the Nest SDK as it stands today. Once a user is authenticated, the data that comes back causes the crash below.
How can I get passed this, and still keep ProGuard enabled? I created an issue on the github page but I assume it will not be a high priority by Nest.
09-06 23:49:32.807 15229-15229/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: <my_package>, PID: 15229
java.lang.IllegalStateException: Conflicting property name definitions: 'locale' (for [field com.nestlabs.sdk.Device#b]) vs 'name' (for [method com.nestlabs.sdk.Device#b(0 params)])
at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.findRenamed(Unknown Source)
at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.findNewName(Unknown Source)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._renameProperties(Unknown Source)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collect(Unknown Source)
at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.collectProperties(Unknown Source)
at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.forDeserialization(Unknown Source)
at com.fasterxml.jackson.databind.introspect.BasicClassIntrospector.forDeserialization(Unknown Source)
at com.fasterxml.jackson.databind.DeserializationConfig.introspect(Unknown Source)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(Unknown Source)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(Unknown Source)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(Unknown Source)
at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(Unknown Source)
at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(Unknown Source)
at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(Unknown Source)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(Unknown Source)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(Unknown Source)
at com.firebase.client.d.a(Unknown Source)
at com.nestlabs.sdk.aa.a(Unknown Source)
at com.firebase.client.c.ba.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Unexplained IncompatibleClassChangeError In Stable Released App Caused by GoogleMaps

I have just received this strange crash report from a user in my Google Play Developer Console.
The app is stable at the moment and this is the first time I have seen this crash. It has been in release for 3/4 months now. The device was a Galaxy S5 running Android Version 5.0.
My initial thoughts is Google Play Services has updated causing issues. Any better offers?
java.lang.IncompatibleClassChangeError: Class 'java.lang.reflect.ArtMethod' does not implement interface 'android.os.Parcelable$Creator' in call to 'java.lang.Object android.os.Parcelable$Creator.createFromParcel(android.os.Parcel)' (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
at com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createParcelable(SafeParcelReader.java:227)
at com.google.android.gms.maps.GoogleMapOptionsCreator.createFromParcel(GoogleMapOptionsCreator.java:93)
at com.google.android.gms.maps.internal.ICreator$Stub.onTransact(ICreator.java:74)
at android.os.Binder.transact(Binder.java:380)
at com.google.android.gms.maps.internal.ah.a(SourceFile:204)
at com.google.android.gms.maps.internal.CreatorImpl.a(SourceFile:110)
at com.google.android.gms.maps.internal.ag.onTransact(SourceFile:79)
at android.os.Binder.transact(Binder.java:380)
at com.google.android.gms.maps.internal.am.a(Unknown Source)
at com.google.android.gms.maps.l.f(Unknown Source)
at com.google.android.gms.maps.l.a(Unknown Source)
at com.google.android.gms.a.b.a(Unknown Source)
at com.google.android.gms.a.b.a(Unknown Source)
at com.google.android.gms.maps.MapView.a(Unknown Source)
at com.myapp.c.d.onActivityCreated(Unknown Source)
at android.support.v4.app.Fragment.performActivityCreated(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source)
at android.support.v4.app.BackStackRecord.run(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(Unknown Source)
at android.support.v4.app.FragmentActivity.onStart(Unknown Source)
at com.myapp.Activity.onStart(Unknown Source)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1234)
at android.app.Activity.performStart(Activity.java:6258)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2621)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2725)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5834)
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:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
ADDITION Have just found this thread which is about other people experiencing the same crash on Samsung devices.
This was related to issue 8314. This issue has now been fixed via both a Firmware update from Samsung and also an update to Google Play Services.
If this helped you, please mark this as the correct answer.

Categories

Resources