Android Question Solved: Error with Push Service Android 5

bgsoft

Well-Known Member
Licensed User
Longtime User
Hello

I have an application that works well when registering for push service:

B4X:
Dim i AsIntent
i.Initialize("com.google.android.c2dm.intent.REGISTER", "")
i.PutExtra("sender", PushSenderId)

In the manifest, there are put this line:
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="21"/>

A customer has installed Android 5 on your Nexus 4 and gives this error in the Google Developer Console in "Errors and ANR" :

java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }
at anywheresoftware.b4a.keywords.Common$5.run(Common.java:965)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
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:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:201)
at anywheresoftware.b4a.keywords.Common$5.run(Common.java:962)
... 8 more
Caused by: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }
at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1674)
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1703)
at android.app.ContextImpl.startService(ContextImpl.java:1687)
at android.content.ContextWrapper.startService(ContextWrapper.java:515)
at anywheresoftware.b4a.keywords.Common.StartService(Common.java:726)
at bgs.ayuntamientovallirana.pushservice._registerdevice(pushservice.java:788)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)



What could be the problem? With Android versions below 5 in the same device and the same application did not have any error.

Thank You

 

bgsoft

Well-Known Member
Licensed User
Longtime User
Thank you very much Erel
 
Upvote 0
Top