Upgraded to Cordova 3.6 and unable to display marker images
I'm using the latest release of this amazing plugin. I looked at the logs and this.cordova is null in PluginMarker.java on line 465. Any ideas? The logs show the following:
W/System.err(13855): java.lang.reflect.InvocationTargetException W/System.err(13855): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err(13855): at java.lang.reflect.Method.invoke(Method.java:515) W/System.err(13855): at plugin.google.maps.MyPlugin.execute(MyPlugin.java:50) W/System.err(13855): at plugin.google.maps.GoogleMaps$3.run(GoogleMaps.java:230) W/System.err(13855): at android.os.Handler.handleCallback(Handler.java:733) W/System.err(13855): at android.os.Handler.dispatchMessage(Handler.java:95) W/System.err(13855): at android.os.Looper.loop(Looper.java:136) W/System.err(13855): at android.app.ActivityThread.main(ActivityThread.java:5001) W/System.err(13855): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err(13855): at java.lang.reflect.Method.invoke(Method.java:515) W/System.err(13855): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) W/System.err(13855): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) W/System.err(13855): at dalvik.system.NativeStart.main(Native Method) W/System.err(13855): Caused by: java.lang.NullPointerException W/System.err(13855): at plugin.google.maps.PluginMarker.setIcon_(PluginMarker.java:465) W/System.err(13855): at plugin.google.maps.PluginMarker.createMarker(PluginMarker.java:131)
@jgibbons , Could you tell me what version you do use, v1.1.5 or v1.2.0 beta x?
Thanks @wf9a5m75! I'm using v1.2.0 test branch.
I see. Cordova v3.6 changes CordovaPlugin.java implementation. Cordova v3.6 https://github.com/apache/cordova-android/blob/3.6.x/framework/src/org/apache/cordova/CordovaPlugin.java#L59
Cordova v3.5 https://github.com/apache/cordova-android/blob/3.5.x/framework/src/org/apache/cordova/CordovaPlugin.java#L43
@jgibbons Thank you for letting me know. Cordova 3.6 changes the flow to initialize plugins. So I need to add some code to support both Cordova 3.5 and Cordova 3.6. Stay tuned.
Thanks @wf9a5m75! For others encountering the issue, just convert your images to their base64 version and they'll load fine on the map. It's a bit of a hack and probably isn't too performant on older Androids, but it works.