mapsplugin / cordova-plugin-googlemaps

Google Maps plugin for Cordova
Apache License 2.0
1.66k stars 913 forks source link

Error loading some custom markers #2889

Open CodeWithOz opened 2 years ago

CodeWithOz commented 2 years ago

I'm submitting a ... (check one with "x")

OS: (check one with "x")

cordova information: (run $> cordova plugin list)

branch-cordova-sdk 3.2.0 "branch-cordova-sdk"
com.googlemaps.ios 3.5.0 "Google Maps SDK for iOS"
cordova-android-support-gradle-release 3.0.1 "cordova-android-support-gradle-release"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-android-notch 1.0.0 "AndroidNotch"
cordova-plugin-android-permissions 1.0.2 "Permissions"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-contacts 3.0.1 "Contacts"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-enable-multidex 0.2.0 "Enable Multidex"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-googlemaps 2.7.0-20191107-1035 "cordova-plugin-googlemaps"
cordova-plugin-googleplus 5.3.2 "Google SignIn"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 2.5.1 "cordova-plugin-ionic-webview"
cordova-plugin-ios-camera-permissions 1.2.0 "iOS Permissions"
cordova-plugin-media-capture 3.0.3 "Capture"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-purchase 9.0.0 "Purchase"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-video-editor 1.1.3 "VideoEditor"
cordova-plugin-x-socialsharing 5.6.3 "SocialSharing"
cordova-sqlite-storage 5.0.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
cordova.plugins.diagnostic 5.0.1 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"
pushwoosh-cordova-plugin 7.18.7 "Pushwoosh"

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

@ionic-native/core : 
@ionic-native/google-maps : 

Current behavior:

When I try to use custom markers from my server, I get the default red icon instead of the marker. For the first 2-3s after adding the marker, the marker doesn't show. Then the default red icon shows.

Expected behavior:

The image from my server should show instead of the default red icon

Screen capture or video record: It's just the red marker showing, nothing unusual to demonstrate with the screenshot. --->

Related code, data or error log (please format your code or data):

10-28 15:03:29.594 27327 32067 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap
.isRecycled()' on a null object reference                                                                                                     
10-28 15:03:29.595 27327 32067 W System.err:    at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:54)                   
10-28 15:03:29.595 27327 32067 W System.err:    at android.graphics.BaseCanvas.drawBitmap(BaseCanvas.java:102)
10-28 15:03:29.595 27327 32067 W System.err:    at android.graphics.Canvas.drawBitmap(Canvas.java:1386) 
10-28 15:03:29.596 27327 32067 W System.err:    at plugin.google.maps.AsyncLoadImage.doInBackground(AsyncLoadImage.java:393)
10-28 15:03:29.596 27327 32067 W System.err:    at plugin.google.maps.AsyncLoadImage.doInBackground(AsyncLoadImage.java:27)    
10-28 15:03:29.596 27327 32067 W System.err:    at android.os.AsyncTask$2.call(AsyncTask.java:335)                                            10-28 15:03:29.597 27327 32067 W System.err:    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-28 15:03:29.597 27327 32067 W System.err:    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:247)                              10-28 15:03:29.597 27327 32067 W System.err:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
10-28 15:03:29.598 27327 32067 W System.err:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)            10-28 15:03:29.598 27327 32067 W System.err:    at java.lang.Thread.run(Thread.java:764)                                                      
Update

I debugged further and found that this error happens when I use an image that is base64 encoded twice on the server. This plugin only decodes once, so it seems the solution would involve decoding twice. I posted about such a feature request in #2890