ionic-team / ionic-native-google-maps

Google maps plugin for Ionic Native
Other
221 stars 125 forks source link

Blocked Map with the error : TypeError: Cannot redefine property: __pluginDomId #316

Open BelghitiAlaoui-Hicham opened 4 years ago

BelghitiAlaoui-Hicham commented 4 years ago

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

If you choose 'problem or bug report', please select OS: (check one with "x")

cordova information: (run $> cordova plugin list)

cordova-androidx-build 1.0.4 "cordova-androidx-build" cordova-plugin-device 2.0.2 "Device" cordova-plugin-googlemaps 2.8.0-20200601-1013 "cordova-plugin-googlemaps" cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview" cordova-plugin-splashscreen 5.0.2 "Splashscreen" cordova-plugin-statusbar 2.4.2 "StatusBar" cordova-plugin-whitelist 1.3.3 "Whitelist" insert the output from the command here


**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": "^5.26.0",
    "@ionic-native/google-maps": "^5.5.0",
**Current behavior:**
<!-- Describe how the bug manifests. -->
When the maps loaded for the first time, it works perfectly. But when i change the page and i return to the map. it bocks
**Expected behavior:**
<!-- Describe what the behavior would be without the bug. -->

**Screen capture or video record:**
<!--
Please take a screen capture or a screen record. You can upload your files with drag & drop up to 10M bytes.
[Android]
$> adb shell screenrecord /sdcard/capture.mp4
$> adb pull /sdcard/capture.mp4 ./
[iOS]
Use QuickTimer player on Mac
--->

**Related code, data or error log (please format your code or data):**
Unhandled Promise rejection: Cannot redefine property: __pluginDomId ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot redefine property: __pluginDomId
    at Function.defineProperty (<anonymous>)
    at js_CordovaGoogleMaps-for-android_ios.js:530
    at Array.forEach (<anonymous>)
    at CordovaGoogleMaps.removeDomTree (js_CordovaGoogleMaps-for-android_ios.js:521)
    at js_CordovaGoogleMaps-for-android_ios.js:83
    at Array.forEach (<anonymous>)
    at js_CordovaGoogleMaps-for-android_ios.js:78
    at Array.forEach (<anonymous>)
    at js_CordovaGoogleMaps-for-android_ios.js:63
    at ZoneDelegate.invoke (zone-evergreen.js:364) TypeError: Cannot redefine property: __pluginDomId
    at Function.defineProperty (<anonymous>)
    at http://192.168.1.10:8100/plugins/cordova-plugin-googlemaps/www/js_CordovaGoogleMaps-for-android_ios.js:530:14
    at Array.forEach (<anonymous>)
    at CordovaGoogleMaps.removeDomTree (http://192.168.1.10:8100/plugins/cordova-plugin-googlemaps/www/js_CordovaGoogleMaps-for-android_ios.js:521:12)
    at http://192.168.1.10:8100/plugins/cordova-plugin-googlemaps/www/js_CordovaGoogleMaps-for-android_ios.js:83:34
    at Array.forEach (<anonymous>)
    at http://192.168.1.10:8100/plugins/cordova-plugin-googlemaps/www/js_CordovaGoogleMaps-for-android_ios.js:78:66
    at Array.forEach (<anonymous>)
    at http://192.168.1.10:8100/plugins/cordova-plugin-googlemaps/www/js_CordovaGoogleMaps-for-android_ios.js:63:48
    at ZoneDelegate.invoke (http://192.168.1.10:8100/polyfills.js:3470:30)
The person who share your project files on Github (or other git repository) is in faster lane than other people.
Please share your project files on Github or others(Bitbucket, Gitlabs...etc).
If you don't want to share your project files, please create a demo project, then share it.

Screen captures, and/or native logs(such as Logcat, xcode logs) are appreciate.

Giving much information, you are waiting time is less.
Thank you for your cooperation.
koichi259 commented 4 years ago

I'm having this issue after updating everything to androidX, any workaround?

Zer0ne83 commented 3 years ago

Also experiencing this error following androidX inclusion - did either of you manage to find a solution? @koichi259 @BelghitiAlaoui-Hicham ? Thanks in advance - tearing my hair out!

BelghitiAlaoui-Hicham commented 3 years ago

@Zer0ne83, there is something in your code thqt make the map variables read only. An andvice, go to react native is much more complete and also they have a huge community. Personnaly, i switch to react native+expo

Zer0ne83 commented 3 years ago

Thanks for the reply and suggestion, mate. Chasing down another error lead me to https://github.com/ionic-team/ionic-native-google-maps/issues/315#issuecomment-656455979 and the referenced commit seems to have cleared up all errors. Still no idea what was wrong but... yeah :/ Pretty done with Ionic + Angular so I might take your advice and take React Native + Expo out for a spin on the next project. Cheers buddy!

wf9a5m75 commented 3 years ago

@koichi259

ionic cordova plugin rm cordova-plugin-googlemaps

ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps

ionic cordova platform build android
timkovik commented 3 years ago

@koichi259

ionic cordova plugin rm cordova-plugin-googlemaps

ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps

ionic cordova platform build android

Now app crashes when it go to background (open camera/barcodscanner for example)


java.lang.RuntimeException: Unable to stop activity {postsrvs.w/postsrvs.w.MainActivity}: java.lang.IllegalStateException
    at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4152)
    at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4201)
    at android.app.ActivityThread.-wrap24(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:173)
    at android.app.ActivityThread.main(ActivityThread.java:6698)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
Caused by: java.lang.IllegalStateException
    at com.google.android.libraries.maps.ij.zzae.zzb(Preconditions.java:29)
    at com.google.android.libraries.maps.ke.zzae.zze(MapRendererPhoenix.java:253)
    at com.google.android.libraries.maps.ka.zzba.zzC(GoogleMapImpl.java:310)
    at com.google.android.libraries.maps.ka.zzcw.zzh(MapViewDelegateImpl.java:16)
    at com.google.android.libraries.maps.MapView$zza.onStop(MapView.java:18)
    at com.google.android.gms.dynamic.DeferredLifecycleHelper.onStop(Unknown Source:4)
    at com.google.android.libraries.maps.MapView.onStop(MapView.java:39)
    at plugin.google.maps.PluginMap.onStop(PluginMap.java:524)
    at org.apache.cordova.PluginManager.onStop(PluginManager.java:286)
    at org.apache.cordova.CordovaWebViewImpl.handleStop(CordovaWebViewImpl.java:491)
    at org.apache.cordova.CordovaActivity.onStop(CordovaActivity.java:291)
    at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1375)
    at android.app.Activity.performStop(Activity.java:7215)
    at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4149)
    ... 9 more```
timkovik commented 3 years ago

This bug exists in last version of https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps

wf9a5m75 commented 3 years ago

Please ask to Google. According of the log, it seems the problem of the Google Maps SDK for Android itself.

wf9a5m75 commented 3 years ago

All source code is open. Please debug it before asking :)

anshjn commented 3 years ago

Ionic app crashes once app goes into the background. How can we use pause and resume event for this? because bug is there and nobody know how much time google may need to resolve it.