I'm facing a very weird issue. I just upgraded my play-services dependencies from version 10.0.1 to 10.2.0
I'm using these now:
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.google.android.gms:play-services-location:10.2.0'
compile 'com.google.android.gms:play-services-gcm:10.2.0'
Now my app crashes every time I receiver a push notification. Notification is displayed and right after that I get a dialog saying that my app stopped working.
Crash LOG
FATAL EXCEPTION: main
Process: com.avantcar.a2go, PID: 581
java.lang.NoSuchMethodError: No static method zzaaj()Lcom/google/firebase/iid/zzg; in class Lcom/google/firebase/iid/zzg; or its super classes (declaration of 'com.google.firebase.iid.zzg' appears in /data/app/com.avantcar.a2go-1/base.apk:classes69.dex)
at com.google.firebase.messaging.FirebaseMessagingService.zzF(Unknown Source)
at com.google.firebase.iid.zzb.onStartCommand(Unknown Source)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3010)
at android.app.ActivityThread.-wrap17(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1442)
at android.os.Handler.dispatchMessage(Handler.java:102)
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)
It seems like it's crashing because of something related to FCM, but I am not using FCM in my app yet. I'm still using GCM.
I had the same issue and it was because I was using a different version for messaging, so try to use the same version on all firebase related dependencies.
You may want to please check your Android API level.
As mentioned in Google APIs for Android - Release Notes, updating your Google Play Services to 10.2 will require a minimum Android API level of 14.
Here are additional articles/SO post that will also help:
Android Developers Blog
Google Play Services Release Notes are Available for the 10.2 Update — Bye Gingerbread!
Android Google Cloud Messaging (GCM) token generation crash after Firebase-related Google Play Services update
using google play services 10.2.0 and the same for firebase messaging worked for me.
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
for me this configuration
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.0'
fixes multi dupex gradle compilation error on AndroidStudio 2.3.3.
Related
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.
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.
I'm trying to add Firebase Cloud Messaging to my app with no success, as I get the following exception:
1 27336-27336/com.company.here E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.company.here, PID: 27336
java.lang.NoSuchMethodError: No static method zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzaa; or its super classes (declaration of 'com.google.android.gms.common.internal.zzaa' appears in /data/app/com.company.here.debug-1/base.apk)
at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5883)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5475)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5414)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6154)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
Here's what I've checked so far:
google-services is set to 3.0.0 in the project gradle file
I only have one dependency related to firebase, which is 10.2.0
I have jack enabled so I can use lambdas
I have ReactiveAndroid and Retrofit incorporated into the project, perhaps they're interacting badly? That said I didn't see anything suspicious when running ./gradlew app:dependencies
Tried multiDexEnabled = true, didn't make a difference
Had a custom applicationIdSuffix for debug builds, attempted to remove it but it also didn't make a difference
Positioning of apply plug: 'com.google.gms.google-services doesn't seem to matter, currently at end of gradle file
What could be causing this? As best as I can tell, FirebaseInitProvider is calling an internal static method from attachInfo, which in turn attempts to call out to a static method on an SDK-private class that doesn't seem to exist.
So this was weird:
Nothing about my setup changed from last night except I ran the clean project command, added the firebase-core dependency and then built again, and everything started to work.
I had assumed that firebase-messaging pulled all of its dependencies in by itself, but that goes against the setup guide, and the crash makes sense if the internal class FirebaseInitProvider is attempting to access is in the firebase-core dependency.
You probably have a mismatch of one of your play-services dependencies and Firebase in your app level build.gradle.
Having google services at 3.0.0 in your project level build.gradle is fine (com.google.gms:google-services:3.0.0).
For example, if you have dependency com.google.android.gms:play-services-maps:10.2.0 and com.google.firebase:firebase-invites:10.2.0 they must both be the same version 10.2.0.
I am using FCM and while run the app it crashes at FirebaseInstanceId.getInstance().getToken() line and gives below error :
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.google.firebase.FirebaseApp
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
Can anyone help me for solve this issue?
You have to enable the API in Google project console ,and also create the keys which required for FCM from your project console.
Also try to Uninstall your app once and check,because onTokenRefresh() will call once,
Please follow the below link for more information.
https://developers.google.com/cloud-messaging/android/android-migrate-fcm
Please check below once --
Use Google Play services 9.0.0
Android Studio 1.5 or higher
An Android Studio project and its package name.
I updated Google Play Services in my app from 8.4.0 to 9.2.1 and started seeing the following crash coming in multiple times per day:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes()' on a null object reference
at android.util.Base64.decode(Base64.java:118)
at com.google.firebase.iid.zzg.zzkl(Unknown Source)
at com.google.firebase.iid.zzg.zzh(Unknown Source)
at com.google.firebase.iid.zzd.zzb(Unknown Source)
at com.google.firebase.iid.zzd.zzcxa(Unknown Source)
at com.google.firebase.iid.zzd.zzbmu(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.zzcww(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceIdService.zzaa(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceIdService.zzm(Unknown Source)
at com.google.firebase.iid.zzb$2.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
I am not explicitly including Firebase nor have I migrated from GCM yet, but I do have google services in my app. I think Firebase coming in through a dependency of my other play-services integrations or the google-services plugin. Here's a snippet of my build.gradle file:
compile 'com.google.android.gms:play-services-analytics:9.2.1'
compile 'com.google.android.gms:play-services-appindexing:9.2.1'
compile 'com.google.android.gms:play-services-places:9.2.1'
compile 'com.google.android.gms:play-services-gcm:9.2.1'
This crash seems very similar to this one but it's coming from getInstance() rather than getToken() so I'm wondering if anyone knows if I'm missing an integration or something like that? I'm hoping that the only answer isn't to wait for google to fix.
UPDATE: I added Firebase to my app through the dashboard, then generated a new google-services.json file, repackaged my app and released a patch. This did not seem to fix the problem, as I am still seeing occurrences in Crashlytics in the new version.
UPDATE 2: I still haven't found a solution, but I've noticed that these crashes are tapering off in Crashlytics. I had 40 the first day, 30 the second day, 10 the third day, and now down to ~4. This leads me to believe that this bug only affects new users or updating users, of which there were a lot initially as my users' apps upgraded to the new version. I still think this is a bug on Google's end and hope they will fix, but at least it's not as widespread as I initially thought.
As described in my updates, after a few days I saw fewer and fewer of these errors, until now a few weeks later I'm not seeing them at all anymore. So I guess the answer is that this intermittently affects users that are updating their apps, and eventually dies down on its own. Most likely no action is needed on the developer's part.