-
Notifications
You must be signed in to change notification settings - Fork 917
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
Fix #2871 - Resolve blank map when running compiled with latest cordova-android (which uses AGP 4.1.3) #2872
base: master
Are you sure you want to change the base?
Fix #2871 - Resolve blank map when running compiled with latest cordova-android (which uses AGP 4.1.3) #2872
Conversation
@ebhsgit I installed from your fork and I no longer get custom map marker icons. It always uses the default red pin from Google maps. Can you please test on your end to see if you have a similar problem? |
The problem was that I was using a relative path ( |
Please note my fork is not intended for production usage. That said, there shouldn't be any changes related to map markers in the fork. If you find the issue. Feel free to suggest a PR |
I also have the issue with blank map. Works when AGP 4.0.2 is used, but is broken with AGP 4.1.x and above. |
@wf9a5m75 please merge and publish a new version asap! |
Kinda strange, because i don't see any changes that would cause that, but i can confirm what @CodeWithOz said. My Markers that are set via |
I have not tested this fix but if it works please try to merge it so that we can use official release of this plugin and do not have to hack the solution ourselves in code. Without fix we are stuck to [email protected] and can not use latest [email protected] which needs Android Gradle Plugin (AGP) version 4.2.2. Thank you! |
There are no changes in this branch related to markers. Maybe you guys are using a different branch? eg: |
Could you try the 20210804 branch? |
@wf9a5m75 i just tried to install from your branch. I got a lot of build errors, for example: L.92: Cannot resolve symbol 'viewPlugins'
L.102: Inconvertible types; cannot cast 'org.apache.cordova.PluginEntry' to 'plugin.google.maps.PluginMarker'
L.410: Cannot resolve method 'getGoogleMap' in 'PluginMap' in PluginMarker.java and lots of Errors in CordovaGoogleMaps.java, which seems all be related to: L.52: Cannot resolve symbol 'MyPluginLayout' |
Not sure what the issue is with icons. The changes are simple, and are definitely not related to markers. |
@ebhsgit give it a try yourself 😃 |
I am not experiencing any issues with markers |
Do you add at least one via |
Yup. eg:
|
Do you just set the |
|
Strange, Version |
I was able to build the plugin in ionic v5 project at least. |
@wf9a5m75 I completely removed the |
Okay i debugged a bit more, looks like this Marker Problem is |
Sadly still white map :( |
It really needs to be fixed soon, because the switch to Android 11 (API Level 30) will be required by Google from 1st Nov 2021. Can the current fix be used in production at least? |
The fix 1de03cd seemes to solve the white map issue but unfortunately, the app crashes when loading custom markers. |
Actually, this fix by @ebhsgit seems to work with a clean install (reinstall platform and plugins, and also remove package-lock.json) 0b8ea76. With the merge commit 1de03cd I got some build errors as pointed out by @EinfachHans |
@wf9a5m75 any timeline on when this will be merged. Many of us are waiting for the fix since switch to Android 11 (API Level 30) will be required by Google from 1st Nov 2021. Could you please provide your thoughts upon this. Thanks |
@alexp25 comment out line 1150 and 1151 (result.image.recycle(),result.image = null) in the file src/android/plugin/google/maps/PluginMarker.java then custom markers work fine |
@alexp25 @lrobak0 can someone please help me installing commit 1de03cd Currently I am installing via below command Is this correct? |
@lrobak0 thanks for the quick response. If I get it right you meant, Quick questions:
|
@sachi097 you can also define it in the package.json: "cordova-plugin-googlemaps": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps.git#0b8ea76ad34fb2a202a9de1b9d0e051a82ad9443" In my case, having a large project with lots of plugins, lots of features, custom markers, interactions:
|
yes,
|
@alexp25 @lrobak0 thanks for your answers. As per @lrobak0 comment installed the plugin via Summary:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and approved with
"cordova-android": "^10.1.1",
"cordova-plugin-androidx-adapter": "^1.1.3",
"cordova-plugin-googlemaps": "github:mapsplugin/cordova-plugin-googlemaps#0b8ea76ad34fb2a202a9de1b9d0e051a82ad9443",
Additional info for anyone struggling with the cordova-android@10 upgrade
- As I'm using
"cordova-plugin-geolocation": "^4.1.0",
, I had to add<custom-preference delete="true" name="android-manifest/uses-feature[@android:name='android.hardware.location.gps']" />
(plugincordova-custom-config
is necessary) in myconfig.xml
and set"cordova-plugin-geolocation": { "GPS_REQUIRED": "false" },
in mypackage.json
. (because both plugins add this entry in AndroidManifest.xml, the build will crash. This line removes one of the two entries) - I also set
<preference name="AndroidInsecureFileModeEnabled" value="true" />
as I'm still usingfile://
scheme internally.
@wf9a5m75 could you merge this PR and release 2.7.2 to help others migrate to cordova-android@10 ? Thanks!
PR #2887 will fix the customer marker issue mentioned here with cordova-android 10+, without needing to set |
Hello everyone, do you know when you will do the merge of this PR? |
Are there any estimates when this will be merged? |
Kindly Merge thank you for the support :) |
Hi when can you merge this branch? |
Map works like charm in the production. |
Any updates on merging this? Just updated my cordova to android 10 and faced this issue. Testing the PR right now. |
Thank you , this fix Blank White Map Screen , but , now dont fire , plugin.google.maps.event.PANORAMA_READY @wf9a5m75 Any help would be appreciated. |
i have "cordova-android": "^10.1.2", google map not load display white screen any one help me |
Replace these files
CordovaGooleMaps
PluginMap
Copy here: ....\<PROJECTNAME>\platforms\android\app\src\main\java\plugin\google\maps
…________________________________
From: subha-menuHuts ***@***.***>
Sent: Thursday, December 8, 2022 8:02 AM
To: mapsplugin/cordova-plugin-googlemaps ***@***.***>
Cc: Guillermo Franco ***@***.***>; Comment ***@***.***>
Subject: Re: [mapsplugin/cordova-plugin-googlemaps] Fix #2871 - Resolve blank map when running compiled with latest cordova-android (which uses AGP 4.1.3) (#2872)
i have
"cordova-android": "^10.1.2",
"cordova-plugin-androidx-adapter": "^1.1.3",
"cordova-plugin-googlemaps": "^2.7.1",
google map not load display white screen
any one help me
—
Reply to this email directly, view it on GitHub<#2872 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIJPNTMDXNQGLISIN27V5IDWMHE5PANCNFSM45IT6X7Q>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Fix #2871
From AGP 4.1.+
assert
keyword/statements are enabled by the compile through code rewrite.Which is causing PluginMap to fail
The issue is caused by
PluginMap
being initialised 2 times. The 2nd time it is initialised,CordovaPlugin.privateInitialize
hasassert
to prevent this.This PR removes initialising the
PluginMap
inCordovaGoogleMaps.getMap
, because when it is added toPluginManager
it will be initialised then.NOTE
Although the relevant code in
PluginManager
andCordovaPlugin
has not been changed for many years.The plugin's codebase works for older cordova-android versions because they use older AGP.
In these older versions,
assert
keyword/statement do nothing