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 on MapContainer of GoogleMaps Lib #3199

Closed
diamondobama opened this issue Aug 3, 2020 · 6 comments
Closed

NullPointerException on MapContainer of GoogleMaps Lib #3199

diamondobama opened this issue Aug 3, 2020 · 6 comments

Comments

@diamondobama
Copy link
Contributor

Create an app and add the GoogleMaps extension.

Create a simple form with a MapContainer

MapContainer googleMap = new MapContainer();
form.add(CENTER, googleMap);

It throws the following exception:

[EDT] 0:0:8,83 - Exception: java.lang.NullPointerException - null
java.lang.NullPointerException
at com.codename1.ui.Container.insertComponentAtImpl(Container.java:926)
at com.codename1.ui.Container.insertComponentAt(Container.java:918)
at com.codename1.ui.Container.addComponent(Container.java:855)
at com.codename1.ui.BrowserComponent$9.run(BrowserComponent.java:534)
at com.codename1.ui.Display.processSerialCalls(Display.java:1331)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1274)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1162)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)

@diamondobama diamondobama changed the title NullPointerException on MapContainer of Google Maps Lib NullPointerException on MapContainer of GoogleMaps Lib Aug 3, 2020
@shai-almog
Copy link
Collaborator

Make sure to add the JavaScript key for google maps.

@diamondobama
Copy link
Contributor Author

diamondobama commented Aug 4, 2020

I added the key. I excluded it above for simplicity.

I must mention that the Exception started showing last Friday.

@shai-almog
Copy link
Collaborator

Did you pass it in the constructor too?

@diamondobama
Copy link
Contributor Author

Yes, I did. The app was working fine until last Friday. The exception seems related to the BrowserComponent.

@shai-almog
Copy link
Collaborator

I'm guessing the CEF change broke that: https://www.codenameone.com/blog/big-changes-jcef.html
Make sure you either use CEF or use a VM that includes JavaFX in it.

@diamondobama
Copy link
Contributor Author

Yes, that's the issue. MapContainer is now showing.

Below StackTrace might be of use to you or @shannah, especially the non-intrusive exception part.

CEF Args: [--disable-gpu, --disable-software-rasterizer, --disable-gpu-compositing, --touch-events=enabled, --enable-media-stream, --device-scale-factor=4, --force-device-scale-factor=4, --autoplay-policy=no-user-gesture-required, --enable-usermedia-screen-capturing]
Using:
JCEF Version = 83.4.0.260
CEF Version = 83.4.0
Chromium Version = 83.0.4103.106
initialize on Thread[AWT-EventQueue-0,6,main] with library path C:\Users\Diamond.codenameone\cef\lib\win64
Added scheme search://
Added scheme client://
Added scheme cn1stream://

DevTools listening on ws://127.0.0.1:8088/devtools/browser/3267ccb2-8c24-476e-b0d8-5d88d5087c8f
AppHandler.stateHasChanged: NEW
AppHandler.stateHasChanged: INITIALIZING
Rendering frame took too long 698 milliseconds
AppHandler.stateHasChanged: INITIALIZED
Setting URL but not ready https://cn1app/streams/1
Running ready callbacks
Setting url https://cn1app/streams/1
Rendering frame took too long 307 milliseconds
Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0" Stream was closed
Address changed to https://cn1app/streams/1
[0805/214308.335:INFO:CONSOLE(22)] "Here I am !!!", source: https://cn1app/streams/1 (22)

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