Change in MapComponent?

90 views
Skip to first unread message

kevin....@gmail.com

unread,
Feb 28, 2014, 9:59:08 AM2/28/14
to codenameone...@googlegroups.com

I have been using a MapComponent with the GoogleMapsProvider as the source of the map data.  This has been working well for my needs.  The last build I did, I find that the map never draws on my phone.  My location pins show up as expected, and they move across the screen as I'm driving around, but no map!
It works fine in the simulator (although I wish the coordinates didn't change so fast there: I get nullpointerexceptions because the map moves faster than the interface can draw it), but it hasn't worked on the phone (android 2.3.5; I will check a 4.X device later).

Anyone know if there has been a very recent change to the MapComponent that would cause this behavior?

Thanks.

Steve Hannah

unread,
Feb 28, 2014, 10:08:20 AM2/28/14
to codenameone...@googlegroups.com

Can you estimate some bounds on when the change would have occurred?

--
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 codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/1e8e5892-c67d-445c-b038-9566e56932c1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

kevin....@gmail.com

unread,
Feb 28, 2014, 10:23:25 AM2/28/14
to codenameone...@googlegroups.com, kevin....@gmail.com
Sorry, I can't really be precise, but the new build I did yesterday (2/27/14) showed the problem behavior, and a prior build that showed the map correctly was probably at least 2 months ago.

Steve Hannah

unread,
Feb 28, 2014, 10:24:26 AM2/28/14
to codenameone...@googlegroups.com

Can you post a stack trace for the null pointers?

--
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 codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

kevin....@gmail.com

unread,
Feb 28, 2014, 10:30:21 AM2/28/14
to codenameone...@googlegroups.com, kevin....@gmail.com
To be clear, the null pointer exceptions only happen in the simulator, and like I said, I think it's only because the simulated position updates happen too fast for the simulator to draw them quickly enough.  The simulator has me flying over Manhattan at about 200 mph, I would guess.  If that's what you want to see, I can supply it.


On Friday, February 28, 2014 9:59:08 AM UTC-5, kevin....@gmail.com wrote:

Steve Hannah

unread,
Feb 28, 2014, 10:32:11 AM2/28/14
to codenameone...@googlegroups.com

It might be helpful.  Especially since, at this point, that sounds like all we have to go on.

--
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 codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

kevin....@gmail.com

unread,
Feb 28, 2014, 10:37:33 AM2/28/14
to codenameone...@googlegroups.com, kevin....@gmail.com
Here is the stack trace during one such run:

java.lang.NullPointerException
at com.codename1.maps.MapComponent.paintBackground(MapComponent.java:216)
at com.codename1.maps.MapComponent.paintBackground(MapComponent.java:216)
[Timer-3] 0:0:6,711 -  Current Location: 40.72835299999997 -73.99197299999993
[Timer-3] 0:0:6,711 - Starting Location: 40.72535299999998 -73.99497299999994
at com.codename1.ui.Component.internalPaintImpl(Component.java:1020)
[Timer-3] 0:0:6,712 - result = 0.4185530948824712
at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
at com.codename1.ui.Component.paintInternal(Component.java:984)
at com.codename1.ui.Component.paintInternal(Component.java:952)
at com.codename1.ui.Component.paintComponent(Component.java:1229)
at com.codename1.ui.Component.paintComponent(Component.java:1181)
at com.codename1.impl.CodenameOneImplementation.paintDirty(CodenameOneImplementation.java:462)
at com.codename1.impl.javase.JavaSEPort.paintDirty(JavaSEPort.java:979)
at com.codename1.ui.Display.edtLoopImpl(Display.java:998)
at com.codename1.ui.Display.mainEDTLoop(Display.java:925)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)


On Friday, February 28, 2014 9:59:08 AM UTC-5, kevin....@gmail.com wrote:

Steve Hannah

unread,
Feb 28, 2014, 10:53:42 AM2/28/14
to codenameone...@googlegroups.com

That's a strange place to get a null pointer.  It looks like it failed to create the buffer mutable image.  But it seems like this should never happen.  Are there any other warnings or errors leading up to this?

--
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 codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

kevin....@gmail.com

unread,
Feb 28, 2014, 11:00:02 AM2/28/14
to codenameone...@googlegroups.com
Ran it one more time and here's what I got.  After I get this error, the display no longer updates, but the location listener continues to spit out the coordinates.

= Cleaning cache
Initial: 304200944
Available: 365032344
Total: 466092032
java.lang.NullPointerException
at com.codename1.maps.MapComponent.paintBackground(MapComponent.java:216)
at com.codename1.ui.Component.internalPaintImpl(Component.java:1020)
at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
[EDT] 0:0:15,30 - java.lang.NullPointerException
[EDT] 0:0:15,37 - java.lang.NullPointerException
[Timer-2] 0:0:15,67 -  Current Location: 40.765352999999884 -73.95497299999975
[Timer-2] 0:0:15,68 - Starting Location: 40.76335299999989 -73.95697299999976
[Timer-2] 0:0:15,68 - result = 0.27897803029574403
at com.codename1.ui.Component.paintInternal(Component.java:984)
at com.codename1.ui.Container.paint(Container.java:950)
at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
at com.codename1.ui.Component.paintInternal(Component.java:984)
at com.codename1.ui.Container.paint(Container.java:950)
at com.codename1.ui.Component.internalPaintImpl(Component.java:1035)
at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
at com.codename1.ui.Component.paintInternal(Component.java:984)
at com.codename1.ui.Container.paint(Container.java:950)
at com.codename1.ui.Form.paint(Form.java:2726)
at com.codename1.ui.Component$BGPainter.paint(Component.java:4191)
[Timer-2] 0:0:15,363 -  Current Location: 40.76635299999988 -73.95397299999975
[Timer-2] 0:0:15,363 - Starting Location: 40.76335299999989 -73.95697299999976
[Timer-2] 0:0:15,363 - result = 0.41846587707740684
at com.codename1.ui.Component.paintBackgroundImpl(Component.java:1379)
at com.codename1.ui.Component.paintBackground(Component.java:1353)
at com.codename1.ui.Container.paintBackground(Container.java:1723)
at com.codename1.ui.Form.paintBackground(Form.java:1102)
at com.codename1.ui.Form.paint(Form.java:2724)
at com.codename1.ui.Component$BGPainter.paint(Component.java:4191)
at com.codename1.ui.Component.paintBackgroundImpl(Component.java:1379)
at com.codename1.ui.Component.paintBackground(Component.java:1353)
at com.codename1.ui.Container.paintBackground(Container.java:1723)
at com.codename1.ui.Form.paintBackground(Form.java:1102)
at com.codename1.ui.Component.internalPaintImpl(Component.java:1020)
at com.codename1.ui.Form.internalPaintImpl(Form.java:2736)
at com.codename1.ui.Component.paintInternalImpl(Component.java:1009)
at com.codename1.ui.Component.paintInternal(Component.java:984)
at com.codename1.ui.Component.paintInternal(Component.java:952)
at com.codename1.ui.Component.paintComponent(Component.java:1229)
at com.codename1.ui.Component.paintComponent(Component.java:1181)
at com.codename1.impl.CodenameOneImplementation.paintDirty(CodenameOneImplementation.java:462)
at com.codename1.impl.javase.JavaSEPort.paintDirty(JavaSEPort.java:979)
at com.codename1.ui.Display.edtLoopImpl(Display.java:998)
at com.codename1.ui.Display.invokeAndBlock(Display.java:1129)
at com.codename1.ui.Display.invokeAndBlock(Display.java:1164)
at com.codename1.ui.Form.showModal(Form.java:1479)
at com.codename1.ui.Dialog.showModal(Dialog.java:1085)
at com.codename1.ui.Dialog.show(Dialog.java:466)
at com.codename1.ui.Dialog.showPackedImpl(Dialog.java:1362)
at com.codename1.ui.Dialog.showPacked(Dialog.java:1273)
[Timer-2] 0:0:15,664 -  Current Location: 40.76735299999988 -73.95297299999974
[Timer-2] 0:0:15,664 - Starting Location: 40.76335299999989 -73.95697299999976
at com.codename1.ui.Dialog.showImpl(Dialog.java:1045)
[Timer-2] 0:0:15,665 - result = 0.557952991630923
at com.codename1.ui.Dialog.show(Dialog.java:1027)
at com.codename1.ui.Dialog.show(Dialog.java:985)
at com.codename1.ui.Dialog.show(Dialog.java:774)
at com.codename1.ui.Dialog.show(Dialog.java:727)
at com.codename1.ui.Dialog.show(Dialog.java:692)
at com.codename1.ui.Dialog.show(Dialog.java:536)
at com.codename1.ui.Dialog.show(Dialog.java:788)
at com.codename1.ui.Display.mainEDTLoop(Display.java:938)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)


To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.

Steve Hannah

unread,
Feb 28, 2014, 11:44:47 AM2/28/14
to codenameone...@googlegroups.com
I don't know.  Maybe Shai or Chen have some ideas.  If you can provide some errors from the android log it might shed some light.


To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Steve Hannah
Web Lite Solutions Corp.

kevin....@gmail.com

unread,
Feb 28, 2014, 12:39:23 PM2/28/14
to codenameone...@googlegroups.com
Okay, I just updated my CodenameOne libraries, and everything is different now.  Different from the standpoint that I now no longer get a map in the simulator.  The location listener is working correctly, I get all of the POI's that I'm expecting, I just don't get a map!  And the simulator no longer throws NullPointerExceptions.  I'm sure things are working much better now that I've got current libraries, but I can't explain why I'm not seeing a map.  When I look at the map in the debugger, I see 9 tiles loaded, so I know (I think) that I'm getting map data, it just isn't being displayed.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com.

--
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 codenameone-discussions+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.

Shai Almog

unread,
Feb 28, 2014, 1:14:31 PM2/28/14
to codenameone...@googlegroups.com, kevin....@gmail.com
If you don't use google provider does that work?
Its possible you ran out of quota to the map API.

kevin....@gmail.com

unread,
Feb 28, 2014, 1:17:15 PM2/28/14
to codenameone...@googlegroups.com, kevin....@gmail.com
It does!  I see the OpenSteetMap map just fine.  Off to the GoogleApps dashboard!

kevin....@gmail.com

unread,
Feb 28, 2014, 1:46:06 PM2/28/14
to codenameone...@googlegroups.com, kevin....@gmail.com
Okay, checked my Google APIs and the following are turned on: Geocoding, Google Maps Android, Google Maps Geolocation, and Google Places.  I get responses from the Google places API with no problems, and I haven't any quota problems at all.

Still stuck...


On Friday, February 28, 2014 1:14:31 PM UTC-5, Shai Almog wrote:

Chen Fishbein

unread,
Feb 28, 2014, 3:46:14 PM2/28/14
to codenameone...@googlegroups.com
Turn on "static maps" on the Google console.

kevin....@gmail.com

unread,
Feb 28, 2014, 3:51:11 PM2/28/14
to codenameone...@googlegroups.com
Thanks Chen, that fixed it.  However, I'm not sure I understand why.  I had never turned on that API previously, and it has always just worked...
Thanks again.

Shai Almog

unread,
Mar 1, 2014, 3:07:56 AM3/1/14
to codenameone...@googlegroups.com, kevin....@gmail.com
Google has the habit of changing stuff all the time without proper QA e.g. see our recent App Engine issue.

Gareth Murfin

unread,
Mar 25, 2014, 10:28:03 AM3/25/14
to codenameone...@googlegroups.com, kevin....@gmail.com
I can confirm these same null pointers, I just spent a month trying to fix it, only happens on bb/android for me. Im about to update the libraries so I hope its gone :D 

From Android:

W/System.err(16978): java.lang.NullPointerException
W/System.err(16978):    at com.codename1.f.e.b(MapComponent.java:218)
W/System.err(16978):    at com.codename1.l.i.b(Component.java:1111)
W/System.err(16978):    at com.codename1.l.i.d(Component.java:1100)
W/System.err(16978):    at com.codename1.l.i.a(Component.java:1075)
W/System.err(16978):    at com.codename1.l.j.a(Container.java:957)
W/System.err(16978):    at com.codename1.l.i.b(Component.java:1126)
W/System.err(16978):    at com.codename1.l.i.d(Component.java:1100)
W/System.err(16978):    at com.codename1.l.i.a(Component.java:1075)
W/System.err(16978):    at com.codename1.l.j.a(Container.java:957)
W/System.err(16978):    at com.codename1.l.i.b(Component.java:1126)
W/System.err(16978):    at com.codename1.l.i.d(Component.java:1100)
W/System.err(16978):    at com.codename1.l.i.a(Component.java:1075)
W/System.err(16978):    at com.codename1.l.j.a(Container.java:957)
W/System.err(16978):    at com.codename1.l.p.a(Form.java:2804)
W/System.err(16978):    at com.codename1.l.i.b(Component.java:1126)
W/System.err(16978):    at com.codename1.l.p.b(Form.java:2814)
W/System.err(16978):    at com.codename1.l.i.d(Component.java:1100)
W/System.err(16978):    at com.codename1.l.i.a(Component.java:1075)
W/System.err(16978):    at com.codename1.l.i.d(Component.java:1043)
W/System.err(16978):    at com.codename1.l.i.c(Component.java:1320)
W/System.err(16978):    at com.codename1.l.i.i(Component.java:1272)
W/System.err(16978):    at com.codename1.impl.a.m(CodenameOneImplementation.java:463)
W/System.err(16978):    at com.codename1.l.m.j(Display.java:998)
W/System.err(16978):    at com.codename1.l.m.i(Display.java:925)
W/System.err(16978):    at com.codename1.l.aa.run(RunnableWrapper.java:120)
W/System.err(16978):    at com.codename1.impl.b$1.run(CodenameOneThread.java:60)
W/System.err(16978):    at java.lang.Thread.run(Thread.java:864)
W/ResourceType(16978): No package identifier when getting value for resource number 0x00000000

Gareth Murfin

unread,
Mar 25, 2014, 10:36:08 AM3/25/14
to codenameone...@googlegroups.com, kevin....@gmail.com
Strangely I get a null pointer at the same time but now not from mapcomponent, from textarea 

java.lang.NullPointerException
   at com.codename1.l.ae.bH(TextArea.java:971)
   at com.codename1.l.ae.bG(TextArea.java:684)
   at com.codename1.l.ae.A(TextArea.java:678)
   at com.codename1.l.j.A(Container.java:687)
   at com.codename1.l.j.A(Container.java:687)
   at com.codename1.l.j.A(Container.java:687)
   at com.codename1.l.j.A(Container.java:687)
   at com.codename1.l.j.A(Container.java:687)
   at com.codename1.l.p.A(Form.java:1402)
   at com.codename1.l.m.a(Display.java:1254)
   at com.codename1.l.aa.run(RunnableWrapper.java:78)
   at com.codename1.l.m.l(Display.java:1075)
   at com.codename1.l.m.j(Display.java:1019)
   at com.codename1.l.m.i(Display.java:925)
   at com.codename1.l.aa.run(RunnableWrapper.java:120)
   at com.codename1.impl.b$1.run(CodenameOneThread.java:60)
   at java.lang.Thread.run(Thread.java:864)

Chen Fishbein

unread,
Mar 25, 2014, 11:56:23 AM3/25/14
to codenameone...@googlegroups.com, kevin....@gmail.com
Make sure you are not violating the EDT, I am guessing you are changing the text of the TextArea not from the EDT thread
Reply all
Reply to author
Forward
0 new messages