Question:
Whenever device receives a notification, it opens the app forcefully when my app is not running or in background. This is the error I'm receiving when app is in background.
2018-11-21 16:28:48.270 1468-1849/? I/ActivityManager: Start proc 10443:com.adda52.rummyapp.free/u0a409 for broadcast com.adda52.rummyapp.free/com.google.android.gms.gcm.GcmReceiver
2018-11-16 13:45:37.898 26223-26223/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.adda52.rummyapp.free, PID: 26223
java.lang.RuntimeException: Unable to start receiver com.google.android.gms.gcm.GcmReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.adda52.rummyapp.free cmp=com.adda52.rummyapp.free/com.pushwoosh.GCMListenerService (has extras) }: app is in background uid UidRecord{c21962 u0a246 RCVR idle procs:1 seq(0,0,0)}
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3350)
at android.app.ActivityThread.-wrap17(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1718)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6673)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.adda52.rummyapp.free cmp=com.adda52.rummyapp.free/com.pushwoosh.GCMListenerService (has extras) }: app is in background uid UidRecord{c21962 u0a246 RCVR idle procs:1 seq(0,0,0)}
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1520)
at android.app.ContextImpl.startService(ContextImpl.java:1476)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService(WakefulBroadcastReceiver.java:91)
at com.google.android.gms.gcm.GcmReceiver.doStartService(Unknown Source:22)
at com.google.android.gms.gcm.GcmReceiver.zze(Unknown Source:0)
at com.google.android.gms.gcm.GcmReceiver.onReceive(Unknown Source:98)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3343)
at android.app.ActivityThread.-wrap17(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1718)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6673)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
2018-11-16 17:03:39.999 27788-27788/com.adda52.rummyapp.free E/Pushwoosh: You have firebase instance.
Please, remove 'com.pushwoosh:pushwoosh-gcm' library from your app build.gradle.
Or disable firebase from your project by removing "apply plugin: 'com.google.gms.google-services'" line.
Otherwise pushwoosh library can work incorrect.
Answer: Your app is launched in response to the following receiver:
2018-11-21 16:28:48.270 1468-1849/? I/ActivityManager: Start proc 10443:com.adda52.rummyapp.free/u0a409 for broadcast com.adda52.rummyapp.free/com.google.android.gms.gcm.GcmReceiver
Please note that com.google.android.gms.gcm.GcmReceiver is automatically added by Pushwoosh SDK with the following parameters:
<receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:permission="com.google.android.c2dm.permission.SEND" android:exported="true">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<category android:name="com.adda52.rummyapp.free"/>
</intent-filter>
</receiver>
<service android:name="com.pushwoosh.PushGcmIntentService" android:exported="false">
<intent-filter android:priority="-50">
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
Please look into your final AndroidManfest.xml (by decompiling your .apk) and check if you have any other receivers with the same name. One of those receivers can intercept intents and launch your app. Please try removing it and check if the same behavior persists.
Comments
0 comments
Please sign in to leave a comment.