Firebase Crash Library - NullPointerException in the console - android

I've implemented the new Firebase Crash library (https://github.com/firebase/quickstart-android/tree/master/crash) to log error in Android app.
Anyone is having similar problem.
I'm checking errors and on the top I've got:
Exception java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes()' on a null object reference
android.util.Base64.decode (Base64.java:118)
com.google.firebase.iid.zzg.zzeH (zzg.java:)
com.google.firebase.iid.zzg.zzeE (zzg.java:)
com.google.firebase.iid.zzd.zzCd (zzd.java:)
com.google.firebase.iid.zzd.zzc (zzd.java:)
com.google.firebase.iid.zzd.getToken (zzd.java:)
com.google.firebase.iid.FirebaseInstanceId.getToken (FirebaseInstanceId.java:)
com.google.firebase.iid.FirebaseInstanceId.zzUo (FirebaseInstanceId.java:)
com.google.firebase.iid.FirebaseInstanceIdService.zza (FirebaseInstanceIdService.java:)
com.google.firebase.iid.FirebaseInstanceIdService.zzm (FirebaseInstanceIdService.java:)
com.google.firebase.iid.zzb$2.run (zzb.java:)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1112)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:587)
java.lang.Thread.run (Thread.java:818)
I have checked but there are not extra proguard rules for Firebase Crash.
Is it bug in the library? Anyone is having similar problem?
I can't reproduce error on my devices.
The error is strange and I don't know in which place in the application. Nothing so I think it's connected to Crash library.
This is not standard nullexception. It's connected to Firebase Crash library. Why I'm thinking this is library bug - there is no sign on my code/activity here.

It was confirmed by Google that this was bug in the InstanceID library.
All you can do right now is to update to the latest version and hope this will be fixed.
compile 'com.google.firebase:firebase-crash:9.4.0'
Note #1
You can see in the comments that some people are still getting this error. At the moment we can't do nothing more than update to the latest version. If you've been using previous version - update to the latest. We need info from Firebase team about it.
Note #2
This seems to be fixed in 9.4.0 but we still need confirmation

Seems to be fixed in
compile 'com.google.firebase:firebase-crash:9.4.0'

This is a bug in the InstanceID library in 9.0, sorry. We've identified a fix and will include it in a future SDK release.
We believe it should be fairly rare, but please comment if you're seeing a large number of devices.

There is a new version of Google Play Services available: 9.2.1. Apparently it has the fix inside. I'll confirm it once I have enough data.

Related

Uri.java line 475 android.net.Uri$StringUri.<init> com.google.android.gms.ads

I'm getting an error from different device versions (Android 5 - Android 8) since I use ads:
implementation 'com.google.android.gms:play-services-ads:16.0.0'
My error looks like this:
Fatal Exception: java.lang.NullPointerException: uriString
at android.net.Uri$StringUri.<init>(Uri.java:475)
at android.net.Uri$StringUri.<init>(Uri.java)
at android.net.Uri.parse(Uri.java:437)
at com.google.android.gms.ads.internal.video.a.a(:com.google.android.gms.dynamite_adsdynamite#14366046#14.3.66 (040306-213742215):13)
at com.google.android.gms.ads.internal.video.gmsg.f.a(:com.google.android.gms.dynamite_adsdynamite#14366046#14.3.66 (040306-213742215):148)
at com.google.android.gms.ads.internal.webview.j.a(:com.google.android.gms.dynamite_adsdynamite#14366046#14.3.66 (040306-213742215):293)
at com.google.android.gms.ads.internal.webview.ac.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.google.android.gms.ads.internal.util.e.dispatchMessage(:com.google.android.gms.dynamite_adsdynamite#14366046#14.3.66 (040306-213742215):5)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
any help is apreciated
There is a bug in version 17.0.0 either you're using
implementation 'com.google.android.gms:play-services-ads:17.0.0' //or
implementation 'com.google.firebase:firebase-ads:17.0.0'
You can check this thread for more detail.
According to the post from Mobile Ads SDK Team member, issue has been fixed but there is no ETA as of now.
EDIT
I found that above issue is not related to particular admob version. From last week most of the apps with AdMob start crashing, It doesn't matter what admob version you're using. I think there is issue with server side or how they delivered ads(may be getting null in response) and not handled in AdMob SDK level.
So Currently we've
Issue with Server side
May be some issue in version 17.0.0
Issue already submitted to Mobile Ads SDK team so we've only option to wait for server side fixes or we may get another release after 17.0.0.
I also encountered this issue when I upgraded my ads dependency to the latest version, to find a proper solution keep checking this thread as mentioned by #Aryan in other answer. As a workaround for now you can use the following dependency:
implementation 'com.google.android.gms:play-services-ads:15.0.0'
this will keep the crash from occurring.

Android Facebook Account Kit Crash - missing metadata: /com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CN

I am suddenly getting a number of crash reports around this the past few weeks. The crashes indicated missing metadata for certain country code. Most of them have been one of:
PhoneNumberMetadataProto_CN
PhoneNumberMetadataProto_BR
PhoneNumberMetadataProto_IR
The crashes seems to have occurred out of nowhere. I attempted to upgrade the AccountKit version from 4.28.0 to 4.31.0. This resulted in a moving where the crash occurred from com.facebook.accountkit.internal.Utility.parseNumber to com.facebook.accountkit.ui.PhoneNumberTextWatcher.getFormattedNumber but the crash is still occurring.
My next plan of attack is to try including the com.googlecode.libphonenumber dependency directly via Gradle instead of letting it just get included transitively from the AccountKit SDK, but I'm not holding my breath that it will fix the problem. Any other ideas are much appreciated.
I am having same problem here.
i am endup with adding dependency in gradle (like your next plan). Its working fine.
dependencies {
...
compile 'com.googlecode.libphonenumber:libphonenumber:8.+'
}

App crash when connecting to google play games - A fatal developer error has occurred

My game stops when I try to connect it with the google play games. It was working. But suddenly this is happening. It's showing development error occurred. Here's the logcat.
07:34.150 2144-2144/com.sennovations.countermaster E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.sennovations.countermaster, PID: 2144
java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
at com.google.android.gms.common.internal.zze.zzs(Unknown Source)
at com.google.android.gms.common.internal.zzi.zzrk(Unknown Source)
at com.google.android.gms.common.internal.zzh.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5637)
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:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
I have added the meta tags in the manifest.
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="#string/app_id" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
Any help would be appreciated. Thanks
Based on your comments I infer that this wasn't your issue, but as I encountered a similar error that I resolved as follows, I'll add this answer:
Google's documentation (here, for instance) currently instructs us to add
compile 'com.google.android.gms:play-services:11.0.4'
to build.gradle. Notice that it currently advises version 11.0.4. Google adds:
Be sure you update this version number each time Google Play services is updated.
This one line appears to be quite possibly some of the worst advice ever given.
Why? Two reasons.
Suppose you use their free BaseGameUtils, which Google itself encourages. Its build.gradle is set up to use version 8.4.0:
ext.gms_library_version = '8.4.0'
I did this, and used the webpage's advice to use version 11.0.4. The disagreement in library numbers caused the app to crash on both Android Studio emulator and a test device with a stack trace similar to the one above.
To be fair, Android Studio will warn you that things can go wrong with the different version numbers: if you open the Manifest file, it will underline the version numbers and whine that it finds two different version numbers, and it will even tell you which version numbers disagree, but -- this is key -- it won't tell you where to find the other file(s) with different version numbers. If you are importing several libraries, and/or compiling dependencies on GitHub or elsewhere, it can be a bit of a challenge to find the cause.
If your app requests Play Games services 11.0.4, but your emulator and/or phone have a lower version number (e.g., 11.0.2 as on my emulator), then the Games API's connect() will give status RESULT_CANCEL to onActivityResult(). The documentation on these result codes leaves something to be desired, so this can take a while to debug -- in fact, I think I think the crashes above were my only clue that the problem might be with the API version number.
There is a way to check that the device supports the requested API, but most of Google's documentation doesn't tell you to do it, and even BaseGameUtils doesn't seem to check for it. (You want to look at GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE.)
In my particular case, the problem was solved by changing my app's play-services version to 8.4.0. Works beautifully now.

Firebase Analytics keeps causing errors in Android, why?

After I installed Firebase Analytics in my Android app, I keep getting the following error and crash of the app.
10-03 19:08:03.917 17740-17759/******* E/FA: Task exception on worker thread: java.lang.IncompatibleClassChangeError:
The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct
(declaration of 'com.google.firebase.iid.zzg' appears in /data/data/********/files/instant-run/dex/slice-com.google.firebase-firebase-iid-9.0.0_4ac10bd34145eacbd51560cb14cd41a784d8c1aa-classes.dex): com.google.android.gms.measurement.internal.zzt.zzEd(Unknown Source)
Any idea why and what causes this error?
I think something was wrong in the documentation. The instructions didn't tell me this extra step.
I was missing a dependency:
compile 'com.google.firebase:firebase-core:9.6.1'
In the support docs, however it is clearly mentioned. I added it and it works fine now.
What Firebase version are you using? Try to update it to latest version, 9.6
Reference: https://developers.google.com/android/guides/releases

NPE on Facebook SDK 4.10 : Attempt to invoke interface method 'java.lang.Object com.facebook.inject.Lazy.get()' on a null object reference

Background
Recently we've updated the Facebook SDK library to 4.10 (from here).
Before, we had the same bug now and then, but now it seems it occurs a lot more often.
The problem
There is no way for us to understand where and why it occurs.
Here's the crash log:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke
interface method 'java.lang.Object com.facebook.inject.Lazy.get()' on
a null object reference
at android.os.Parcel.readException(Parcel.java:1552)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
at android.content.ContentResolver.query(ContentResolver.java:494)
at android.content.ContentResolver.query(ContentResolver.java:429)
at com.facebook.internal.NativeProtocol.fetchAllAvailableProtocolVersionsForAppInfo(NativeProtocol.java:790)
at com.facebook.internal.NativeProtocol.access$000(NativeProtocol.java:49)
at com.facebook.internal.NativeProtocol$NativeAppInfo.fetchAvailableVersions(NativeProtocol.java:281)
at com.facebook.internal.NativeProtocol$NativeAppInfo.access$600(NativeProtocol.java:226)
at com.facebook.internal.NativeProtocol$1.run(NativeProtocol.java:763)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
And, since it's a report from Crashlytics, I also have some statistics:
usually (90%) occurs on Meizu devices, and the rest on LG, Samsung and others.
usually (72%) occurs on Android 5.1 versions, and the rest on all of the other versions we support (4.x and above).
What I've tried
I tried searching for the exception, but I can't find anything even similar to it.
I tried to find the "com.facebook.inject.Lazy" class, but this is nowhere to be found. I can't even find injection related classes and repos that the sdk uses for normal use. Only for unit testings.
I also tried to go to the Github website of Facebook (here), but there is nowhere to write there.
Later I've found that this was reported on Facebook's developers website , but it doesn't seem that it's going to be fixed, and nobody knows how to handle it.
EDIT: now I've found this Facebook post, which says it might be because of using an old version of Facebook app, but it seem that it's incorrect.
The question
Why does it occur? Is there any workaround for this? Does Facebook work on a fix for this?
Is there any version of the Facebook SDK that this issue doesn't occur?
And, most importantly, How can it be handled and fixed?
Please use updated facebook sdk to overcome this error. old sdk has some problems.
you can download latest sdk from
https://developers.facebook.com/docs/android

Categories

Resources