mapsplugin / cordova-plugin-googlemaps

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

package com.google.android.libraries.maps.model does not exist #2898

Closed craig-at-rsg closed 2 years ago

craig-at-rsg commented 2 years ago

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

OS: (check one with "x")

cordova information: (run $> cordova plugin list)

com.rsginc.exceptionthrower 1.0.0 "com.rsginc.exceptionthrower"
com.rsginc.heartbeat 1.0.0 "Heartbeat"
com.rsginc.mobilesurvey 1.0.0 "Trip Recorder guts"
com.rsginc.proguard 2.0.0 "Cordova plugin ProGuard"
cordova-android-play-services-gradle-release 4.0.0 "cordova-android-play-services-gradle-release"
cordova-androidx-build 1.0.4 "cordova-androidx-build"
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-firebase-analytics 6.1.0 "FirebaseAnalyticsPlugin"
cordova-plugin-firebase-crash 4.2.0 "cordova-plugin-firebase-crash"
cordova-plugin-googlemaps 2.7.1 "cordova-plugin-googlemaps"
cordova-plugin-idfa 2.0.0 "cordova-plugin-idfa"
cordova-plugin-inappbrowser 4.1.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-localization-strings 3.2.1 "Localization"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-request-location-accuracy 2.3.0 "Request Location Accuracy"
cordova-plugin-screen-orientation 3.0.2 "Screen Orientation"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-sqlite-storage 5.1.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
cordova-support-android-plugin 1.0.2 "cordova-support-android-plugin"
es6-promise-plugin 4.2.2 "Promise"

Ionic packages

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

Current behavior:

The Android version won't compile; multiple failures with "package com.google.android.libraries.maps.model does not exist"

Expected behavior:

The code should compile

Related code, data or error log (please format your code or data): I see this output during the build:

---->PLAY_SERVICES_VERSION = 18.0.2
---->ANDROID_SUPPORT_V4_VERSION = 27.1.1

Which show's this plugin's custom gradle is setting the dependencies correctly:

  def PLAY_SERVICES_VERSION = props.get("GOOGLE_MAPS_PLAY_SERVICES_VERSION")
  def ANDROID_SUPPORT_V4_VERSION = props.get("ANDROID_SUPPORT_V4_VERSION")
  println("---->PLAY_SERVICES_VERSION = ${PLAY_SERVICES_VERSION}")
  println("---->ANDROID_SUPPORT_V4_VERSION = ${ANDROID_SUPPORT_V4_VERSION}")
  dependencies {
    implementation "com.google.android.gms:play-services-maps:${PLAY_SERVICES_VERSION}"
    implementation "com.google.android.gms:play-services-location:${PLAY_SERVICES_VERSION}"
    implementation "com.android.support:support-core-utils:${ANDROID_SUPPORT_V4_VERSION}"
  }

In Android Studio's Gradle view, I see:

com.google.android.gms:play-services-maps:18.0.2@aar (Compile)

I went through other issue reports to try to find the problem, and I asked on stackoverflow, but I'm really stuck and hoping someone can help me.

craig-at-rsg commented 2 years ago

The build works for me against the multiple_maps branch, but the map doesn't load for me there. I tried to put a breakpoint at CordovaGoogleMaps.this.getMap(args, callbackContext), but that doesn't seem to get hit. I can keep debugging, but I was hoping someone else could tell me what I'm doing wrong; I was trying to upgrade to target Android SDK 31...

craig-at-rsg commented 2 years ago

I was using the multiple_maps branch, and that would work for me if the map was showing, so I don't need to get the answer to how to compile against the master branch.

zimarron72 commented 2 years ago

I having same issue. I tried to delete cordova plugin androidx, because I read anything about. but nothing