I am making an app on codename one using the google maps API. I added the google maps extension and build hints. When I run the program I get an error on the line where I created the MapContainer like so.
cnt = new MapContainer("API KEY");
The full error is this:
java.lang.NoClassDefFoundError: com/codename1/googlemaps/InternalNativeMaps
at com.codename1.googlemaps.MapContainer.<init>(MapContainer.java:194)
at com.codename1.googlemaps.MapContainer.<init>(MapContainer.java:163)
at milton.app.MyApplication.start(MyApplication.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.codename1.impl.javase.Executor$3$1.run(Executor.java:256)
at com.codename1.ui.Display.processSerialCalls(Display.java:1238)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1033)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.lang.ClassNotFoundException: com.codename1.googlemaps.InternalNativeMaps
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.findSystemClass(ClassLoader.java:1004)
at com.codename1.impl.javase.ClassPathLoader.findClass(ClassPathLoader.java:105)
at com.codename1.impl.javase.ClassPathLoader.loadClass(ClassPathLoader.java:55)
... 12 more
There is also something wrong with the MapContainer.java file. It says that
Library source code does not matchthe bytecode for the class MapContainer
I have created multiple new projects to make sure there was not a problem with my build hints or any other typo but I still I am getting the same error. Please help.