Hi
I got an error message when i send a push message to my game in Android Oreo.
The game works well for all previous version of Android Oreo.
It only happens in Android Oreo.
I have searched many answers in this forum.
Some people say that i have to use FCM instead of GCM.
But I can't change my old Eclipse project to Android Studio
because of many risks.
I use gcm.jar library.
Please help me & thanks in advance!
Logcat
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start receiver com.google.android.gcm.GCMBroadcastReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.example.test cmp=com.example.test/.GCMIntentService (has extras) }: app is in background uid UidRecord{7cd2325 u0a379 RCVR idle change:uncached procs:1 seq(0,0,0)}
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3194)
at android.app.ActivityThread.-wrap17(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.example.test cmp=com.example.test/.GCMIntentService (has extras) }: app is in background uid UidRecord{7cd2325 u0a379 RCVR idle change:uncached procs:1 seq(0,0,0)}
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1518)
at android.app.ContextImpl.startService(ContextImpl.java:1474)
at android.content.ContextWrapper.startService(ContextWrapper.java:649)
at android.content.ContextWrapper.startService(ContextWrapper.java:649)
at com.google.android.gcm.GCMBaseIntentService.runIntentInService(GCMBaseIntentService.java:282)
at com.google.android.gcm.GCMBroadcastReceiver.onReceive(GCMBroadcastReceiver.java:55)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3187)