mapsplugin / cordova-plugin-googlemaps

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

Support for latest Android and iOS Versions #2915

Open hrhosni opened 1 year ago

hrhosni commented 1 year ago

Has anyone forked this repo to continue supporting latest Android (12+) and iOS versions?

keev-studio commented 1 year ago

also desperately looking for working solution for Cordova Android@11

KimberleeDArmstrong commented 1 year ago

I got this one to work with Android 11.
image

keev-studio commented 1 year ago

Hi, I am getting zillions of build errors after adding this repo. eeeee

Can you please send what stack versions you are using?

lempere commented 1 year ago

@keev-studio, @hrhosni You can try that fork https://github.com/we-are-joinup/cordova-plugin-googlemaps/ I'm upgrading to cordova-android@11.0.0 and seems that everything is working.

keev-studio commented 1 year ago

@keev-studio, @hrhosni You can try that fork https://github.com/we-are-joinup/cordova-plugin-googlemaps/ I'm upgrading to cordova-android@11.0.0 and seems that everything is working.

Hi lempere, thank you for your message. I am trying the repo you mentioning. I am getting this error during build fffff What version of gradle are you using for the duild?

lempere commented 1 year ago

That's true, but the error is self explanatory, you need to change:

compile(name:'tbxml-android', ext:'aar') to implementation(name:'tbxml-android', ext:'aar')

inside: platforms/android/cordova-plugin-googlemaps/***-tbxml-android.gradle

keev-studio commented 1 year ago

Hi thank you, I corrected that but now I am getting another group of errors, dont know why. I changed inside: platforms/android/cordova-plugin-googlemaps/***-tbxml-android.gradle as you said, removed and added platform What Gradle, JavaSDK and Node version are you using? gggg

lempere commented 1 year ago

It's seems that the project can find the com.google.android properly. With that screenshot I don't have any clue why. Try running with:

cordova build android --verbose

What Ionic info show:

Ionic:

 ionic (Ionic CLI)  : 4.10.1 (/usr/local/lib/node_modules/ionic)
 Ionic Framework    : ionic-angular 3.9.2
 @ionic/app-scripts : 3.2.4

Cordova:

 cordova (Cordova CLI) : 10.0.0
 Cordova Platforms     : android 11.0.0, browser 6.0.0, ios 6.2.0
 Cordova Plugins       : cordova-plugin-ionic-webview 5.0.0, (and 28 other plugins)

System:

 Android SDK Tools : 26.1.1 (/Users/lempere/Library/Android/sdk)
 ios-deploy        : 1.11.4
 ios-sim           : 8.0.2
 NodeJS            : v12.18.1 (/Users/lempere/.nvm/versions/node/v12.18.1/bin/node)
 npm               : 6.9.0
 OS                : macOS
 Xcode             : Xcode 12.3 Build version 12C33

Another preferences in config.xml, that could help:

<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="32" />    
<preference name="GradlePluginGoogleServicesEnabled" value="true" />
<preference name="GradlePluginGoogleServicesVersion" value="4.3.8" />
<preference name="GradlePluginKotlinEnabled" value="true" />
<preference name="GradlePluginKotlinCodeStyle" value="official" />
<preference name="GradlePluginKotlinVersion" value="1.6.0" />
<preference name="AndroidInsecureFileModeEnabled" value="true" />

If that not helps. Do you have a small project in github to check it out?

keev-studio commented 1 year ago

Hi, I just added your config preferences just to try and getting now some new error referring to google services hhhhh looks like this repo is not compatible somehow, as I am running into error spiral

lempere commented 1 year ago

compileSdkVersion is not specified Try to specify with:

<preference name="android-compileSdkVersion" value="32" />
keev-studio commented 1 year ago

I added to my config but no effect on the error. iiiiii Thank you very much for trying

At the evening I will try the plugin with some simple app without any other plugin to test if it can run in my environment P.S. do you think google play services plugin is needed? In my android@9 environment my app was running with googlemaps plugin without google play services plugin.

lempere commented 1 year ago

Well I see another error. Is a progress. I think will be better if you create a github project with your native configuration and then I can try to build it.

keev-studio commented 1 year ago

Hi, I added minimalistic app with the plugin. No errors, app build at the end but the map is still white / do not load. I created repo with all the files and added you as collaborator if you want to look or build the app. Thank you again for your effort

keev-studio commented 1 year ago

@keev-studio, @hrhosni You can try that fork https://github.com/we-are-joinup/cordova-plugin-googlemaps/ I'm upgrading to cordova-android@11.0.0 and seems that everything is working.

Hi, looks like I got this one working except custom marker icons. any solution for this? thank you EDIT: sorted by changing the path to " file:///android_asset/www/img/YOUR_ICON.webp "

awabbi commented 1 year ago

@keev-studio, @hrhosni You can try that fork https://github.com/we-are-joinup/cordova-plugin-googlemaps/ I'm upgrading to cordova-android@11.0.0 and seems that everything is working.

This fork worked fine for me after replacing "compile" with "implementation". Great work.

nosTa1337 commented 1 year ago

Hi thank you, I corrected that but now I am getting another group of errors, dont know why. I changed inside: platforms/android/cordova-plugin-googlemaps/***-tbxml-android.gradle as you said, removed and added platform What Gradle, JavaSDK and Node version are you using? gggg

I had the same issue and tried a lot. When creating a blank project which was compiling with the fork "https://github.com/we-are-joinup/cordova-plugin-googlemaps/", I was diving inside it.

As I am migrating from Ionic 5 to Ionic 6, I was also getting everything else nearly as up to date as possible.

The issue states that com.google.android.libraries.maps cannot be found. It was replaced in the CordovaGoogleMaps.java file by using the plugin cordova-androidx-build, which seems to be depreceated for my use. Inside this plugin, the paths are replaced and therefore not working anymore.

["com.google.android.gms.maps", "com.google.android.libraries.maps"]

I have removed the plugin and after replacing the compile with implementation my app started working again and also the google maps plugin works as expected.

Thanks mate :)

gbrits commented 12 months ago

That's true, but the error is self explanatory, you need to change:

compile(name:'tbxml-android', ext:'aar') to implementation(name:'tbxml-android', ext:'aar')

inside: platforms/android/cordova-plugin-googlemaps/***-tbxml-android.gradle

Thanks @lempere the repo & the adjustment of implementation got it working for me too.