-
Notifications
You must be signed in to change notification settings - Fork 442
onNewIntent override crashes sometimes when calling startService #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue does not seem to follow the issue template. Make sure you provide all the required information. |
Hi @igor84 according to your error message, an IllegalStateException is thrown if your app targeting Android 8.0 tries to use that method in a situation when it isn't permitted to create background services. Could you try updating your Firebase SDK and Unity Editor to their latest versions and see if the issue persists? |
@igor84 since we're using an IntentService to route data to the C++ SDK I think we have a legit bug here if you're targeting Android 8 or above in this scenario as the |
@paulinon unfortunately since this is only happening in the wild we would have to do these updates on a live project that is already on a tight schedule, so we couldn't do them any time soon. @stewartmiles thanks for looking into this and sorry I can't be of more help :) |
@stewartmiles is there any progress on this? Is there some workaround that we can implement while we wait for a proper fix? |
We have the same issue too. Calling
|
@stewartmiles Then please fix the documentation, which suggests calling |
Hi, I have the same issue using a custom UnityPlayerActivity and following the documentation https://firebase.google.com/docs/cloud-messaging/unity/client#configuring_a_custom_entry_point_activity without extending com.google.firebase.MessagingUnityPlayerActivity Any workaround to prevent crashing ? Unity 2020.1.12f1 EDIT: I added a try / catch bloc surrounding |
Same here. Unity 2018.4.16 |
@stewartmiles |
Hi all, The IntentService that stewartmiles mentioned was converted to a JobIntentService a while back, but it looks like this issue was overlooked. Does this bug still occur with the latest releases? If it's still happening I can investigate further, though remaining crashes would probably have a different root cause. |
Hi, while it might not be related but we just pushed out some changes in Unity SDK 7.1.0 that had some work done to fix some issues with the transition to |
I think this should have been fixed in See also #939 (comment) I will close this issue for now. Please report to #939 if you experience something similar or a new ticket if your ANR event is different. |
Uh oh!
There was an error while loading. Please reload this page.
Please fill in the following fields:
Unity editor version: 2019.1.14f1
Firebase Unity SDK version: 5.7.0
Firebase plugins in use (Auth, Database, etc.): Crashlytics, Messaging
Additional SDKs you are using (Facebook, AdMob, etc.): Facebook
Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows
Platform you are targeting (iOS, Android, and/or desktop): Android
Scripting Runtime (Mono, and/or IL2CPP): IL2CPP
Please describe the issue here:
We followed instructions for configuring a custom entry point Activity at https://firebase.google.com/docs/cloud-messaging/unity/client and added this code to our Activity:
We noticed on Crashlytics a number of crashes happening with following message and stack trace:
Caused by java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE cmp=com.nordeus.heroic/com.google.firebase.messaging.MessageForwardingService }: app is in background uid UidRecord{7abca70 u0a14 LAST bg:+2m48s495ms idle change:idle procs:1 seq(1760,1760,1760)}
at android.app.ContextImpl.startServiceCommon + 1720(ContextImpl.java:1720)
at android.app.ContextImpl.startService + 1675(ContextImpl.java:1675)
at android.content.ContextWrapper.startService + 669(ContextWrapper.java:669)
at eu.nordeus.common.MainPlayerNativeActivity.onNewIntent + 77(MainPlayerNativeActivity.java:77)
at android.app.Activity.performNewIntent + 8080(Activity.java:8080)
at android.app.Instrumentation.callActivityOnNewIntent + 1413(Instrumentation.java:1413)
at android.app.Instrumentation.callActivityOnNewIntent + 1426(Instrumentation.java:1426)
at android.app.ActivityThread.deliverNewIntents + 4002(ActivityThread.java:4002)
at android.app.ActivityThread.handleNewIntent + 4014(ActivityThread.java:4014)
at android.app.servertransaction.NewIntentItem.execute + 53(NewIntentItem.java:53)
at android.app.servertransaction.TransactionExecutor.executeCallbacks + 149(TransactionExecutor.java:149)
at android.app.servertransaction.TransactionExecutor.execute + 103(TransactionExecutor.java:103)
at android.app.ActivityThread$H.handleMessage + 2373(ActivityThread.java:2373)
at android.os.Handler.dispatchMessage + 107(Handler.java:107)
at android.os.Looper.loop + 213(Looper.java:213)
at android.app.ActivityThread.main + 8147(ActivityThread.java:8147)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 513(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main + 1100(ZygoteInit.java:1100)
Please answer the following, if applicable:
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
We couldn't reproduce this issue, we only observed it happening in the wild.
The text was updated successfully, but these errors were encountered: