Skip to content
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

NullPointerException using PlayN.net().get(url,callback) API #69

Open
fredstroup opened this issue Dec 4, 2014 · 5 comments
Open

NullPointerException using PlayN.net().get(url,callback) API #69

fredstroup opened this issue Dec 4, 2014 · 5 comments

Comments

@fredstroup
Copy link

Hi,

1.9-SNAPSHOT
robovm
iPhone 6 with iOS 8.1

Using the PlayN.net().get(url,callback)API the game hangs on the simulator and I saw the following stack several times (but not systematically) on the real device:

java.lang.NullPointerException 
 at playn.robovm.RoboNet$1.connectionDidFinishLoading$(RoboNet.java) 
 at org.robovm.apple.foundation.NSURLConnectionDataDelegate$ObjCProxy.$cb$connectionDidFinishLoading$(Unknown Source) 
 at org.robovm.apple.uikit.UIApplication.main(Native Method) 
 at org.robovm.apple.uikit.UIApplication.main(UIApplication.java) 
 at metro.robovm.MetroRoboVM.main(MetroRoboVM.java)
@samskivert
Copy link
Member

I think this has changed in the latest version of the code. If you can try again with the latest PlayN snapshot (which you'll have to build and install, but that should be as easy as git clone ..blahblahplayn.. ; mvn -f playn/pom.xml install), I'd appreciate knowing if it has been magically fixed or not.

I suspect it might have to do with the headers map being null, but that map now comes through a magic RoboVM marhsaler which may turn a null map into an empty map, I'm not sure.

@samskivert
Copy link
Member

Oh, I just noticed you're using the snapshot. Well, can you just "git pull" and update your snapshot. The latest code should show RoboNet$1.didFinishLoading in the stack trace, not RoboNet$1.connectionDidFinishLoading$, which is old.

@fredstroup
Copy link
Author

Hi,

After the git pull, the stack trace indeed changed, but the NullPointerException is still there.

java.lang.NullPointerException
at playn.robovm.RoboNet$1.didFinishLoading(RoboNet.java)
at org.robovm.apple.foundation.NSURLConnectionDataDelegate$ObjCProxy.$cb$connectionDidFinishLoading$(Unknown Source)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
at metro.robovm.MetroRoboVM.main(MetroRoboVM.java)

Le 6 déc. 2014 à 22:10, Michael Bayne [email protected] a écrit :

Oh, I just noticed you're using the snapshot. Well, can you just "git pull" and update your snapshot. The latest code should show RoboNet$1.didFinishLoading in the stack trace, not RoboNet$1.connectionDidFinishLoading$, which is old.


Reply to this email directly or view it on GitHub.

@samskivert
Copy link
Member

I just pushed a fix to master which hopefully prevents this NPE. If you can check it out and let me know if the problem goes away, I'd appreciate it.

@fredstroup
Copy link
Author

Hi Michael,

I was able to replicate the issue with the real device :

java.lang.NullPointerException
at playn.robovm.RoboNet$1.didFinishLoading(RoboNet.java)
at org.robovm.apple.foundation.NSURLConnectionDataDelegate$ObjCProxy.$cb$connectionDidFinishLoading$(Unknown Source)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
at metro.robovm.MetroRoboVM.main(MetroRoboVM.java)

and with the simulator:

java.lang.NullPointerException
[ERROR]
[ERROR] at playn.robovm.RoboNet.access$300(RoboNet.java)
[ERROR] at playn.robovm.RoboNet$1.didFinishLoading(RoboNet.java)
[ERROR] at org.robovm.apple.foundation.NSURLConnectionDataDelegate$ObjCProxy.$cb$connectionDidFinishLoading$(Unknown Source)
[ERROR] at org.robovm.apple.uikit.UIApplication.main(Native Method)
[ERROR] at org.robovm.apple.uikit.UIApplication.main(UIApplication.java)
[ERROR] at metro.robovm.MetroRoboVM.main(MetroRoboVM.java)

Note that the NPE is not systematic. I managed to use the simulator with the same code with no issues.

Le 15 déc. 2014 à 18:36, Michael Bayne [email protected] a écrit :

I just pushed a fix to master which hopefully prevents this NPE. If you can check it out and let me know if the problem goes away, I'd appreciate it.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants