Sorry guys, 

I forgot to mention this is only happenning in the Android version of the 
app, iOS is working normally.



On Friday, January 5, 2018 at 11:00:38 AM UTC-5, Mario Barón wrote:
>
> Hi guys,
>
> I'm getting a rather weird error when receiving push notifications through 
> Parse using the parse4cn1 library: 
>
> 01-05 10:28:20.143 2539-2539/? W/GCM-DMM: broadcast intent callback: 
> result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE 
> flg=0x10000000 pkg=com.guarumo.ego (has extras) }
> 01-05 10:28:20.176 20803-20803/? D/AndroidRuntime: Shutting down VM
> 01-05 10:28:20.186 20803-20803/? E/AndroidRuntime: FATAL EXCEPTION: main
>                                                    Process: 
> com.guarumo.ego, PID: 20803
>                                                   
>  java.lang.RuntimeException: Unable to start receiver 
> com.parse.CN1ParsePushBroadcastReceiver: java.lang.NullPointerException: 
> Attempt to invoke virtual method 'java.io.InputStream 
> com.codename1.impl.CodenameOneImplementation.getResourceAsStream(java.lang.Class,
>  
> java.lang.String)' on a null object reference
>                                                        at 
> android.app.ActivityThread.handleReceiver(ActivityThread.java:2646)
>                                                        at 
> android.app.ActivityThread.access$1700(ActivityThread.java:155)
>                                                        at 
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394)
>                                                        at 
> android.os.Handler.dispatchMessage(Handler.java:102)
>                                                        at 
> android.os.Looper.loop(Looper.java:135)
>                                                        at 
> android.app.ActivityThread.main(ActivityThread.java:5343)
>                                                        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:905)
>                                                        at 
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
>                                                     Caused by: 
> java.lang.NullPointerException: Attempt to invoke virtual method 
> 'java.io.InputStream 
> com.codename1.impl.CodenameOneImplementation.getResourceAsStream(java.lang.Class,
>  
> java.lang.String)' on a null object reference
>                                                        at 
> com.codename1.ui.Display.getResourceAsStream(Display.java:2615)
>                                                        at 
> com.codename1.io.Log.print(Log.java:331)
>                                                        at 
> com.codename1.io.Log.p(Log.java:284)
>                                                        at 
> com.parse4cn1.util.Logger.debug(Logger.java:89)
>                                                        at 
> com.parse.CN1ParsePushBroadcastReceiver.writeLog(CN1ParsePushBroadcastReceiver.java:185)
>                                                        at 
> com.parse.CN1ParsePushBroadcastReceiver.writeDebugLog(CN1ParsePushBroadcastReceiver.java:198)
>                                                        at 
> com.parse.CN1ParsePushBroadcastReceiver.onPushReceive(CN1ParsePushBroadcastReceiver.java:58)
>                                                        at 
> com.parse.ParsePushBroadcastReceiver.onReceive(ParsePushBroadcastReceiver.java:117)
>                                                        at 
> android.app.ActivityThread.handleReceiver(ActivityThread.java:2639)
>                                                        at 
> android.app.ActivityThread.access$1700(ActivityThread.java:155) 
>                                                        at 
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394) 
>                                                        at 
> android.os.Handler.dispatchMessage(Handler.java:102) 
>                                                        at 
> android.os.Looper.loop(Looper.java:135) 
>                                                        at 
> android.app.ActivityThread.main(ActivityThread.java:5343) 
>                                                        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:905)
>  
>                                                        at 
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) 
>
> When the push is sent and the app is in the foreground, the app does what 
> it's supposed to. I've gone through sidiabale 
> <https://github.com/sidiabale>'s documentation and test app over and over 
> but continue getting the same error. I'm not sure if this may be caused by 
> initializing Parse in a place where it shouldn't be initialize. *PS:* I'm 
> initializing Parse in the "public void init(Object context)" method in 
> the main class for my project right after registering my custom classes to 
> store on local storage. The project is a new GUI Builder project so I don't 
> have a Statemachine.
>
> Thanks in advance, I really appreciate your help.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/1f9a06ff-c6d1-4113-8549-21afefcadfd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to