mapsplugin / cordova-plugin-googlemaps

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

Googlemaps is not installed or not ready yet #2916

Closed lrphael closed 2 years ago

lrphael commented 2 years ago

I'm reopening this error topic on Ionic Cordova, and there are already several similar errors on the internet, but the solutions are not working for me. I'm having this issue when I try to initialize google maps on Android: image

I tried to apply these 2 solutions before the current print which I found on Stackoverflow:

  1. https://stackoverflow.com/a/62437351/8478892
  2. https://stackoverflow.com/a/68746174/8478892

But as you can see, unfortunately they didn't work for me.

That is my plugin list: image

"dependencies": {
    "@angular/common": "~10.0.0",
    "@angular/core": "~10.0.0",
    "@angular/forms": "~10.0.0",
    "@angular/platform-browser": "~10.0.0",
    "@angular/platform-browser-dynamic": "~10.0.0",
    "@angular/router": "~10.0.0",
    "@ionic-native/app-version": "^5.31.1",
    "@ionic-native/camera": "^5.31.1",
    "@ionic-native/core": "^5.36.0",
    "@ionic-native/file": "^5.36.0",
    "@ionic-native/file-transfer": "^5.31.1",
    "@ionic-native/geolocation": "^5.31.1",
    "@ionic-native/google-maps": "^5.27.0-beta-20200630",
    "@ionic-native/ionic-webview": "^5.28.0",
    "@ionic-native/launch-review": "^5.29.0",
    "@ionic-native/sign-in-with-apple": "^5.31.1",
    "@ionic-native/splash-screen": "^5.31.1",
    "@ionic-native/status-bar": "^5.31.1",
    "@ionic/angular": "^5.5.2",
    "@ionic/storage-angular": "^3.0.6",
    "@ngx-translate/core": "^13.0.0",
    "@ngx-translate/http-loader": "^6.0.0",
    "cordova-browser": "6.0.0",
    "lodash-es": "^4.17.20",
    "moment": "^2.27.0",
    "rxjs": "~6.5.5",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/architect": "^0.1301.2",
    "@angular-devkit/build-angular": "~0.1000.0",
    "@angular/cli": "~10.0.5",
    "@angular/compiler": "~10.0.0",
    "@angular/compiler-cli": "~10.0.0",
    "@angular/language-service": "~10.0.0",
    "@ionic/angular-toolkit": "^2.3.0",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^6.0.0",
    "cordova-android": "^10.0.0",
    "cordova-androidx-build": "^1.0.4",
    "cordova-ios": "^6.2.0",
    "cordova-launch-review": "^4.0.1",
    "cordova-plugin-actionsheet": "^2.3.3",
    "cordova-plugin-app-version": "^0.1.12",
    "cordova-plugin-camera": "^5.0.1",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-dialogs": "^2.0.2",
    "cordova-plugin-file": "^7.0.0",
    "cordova-plugin-file-transfer": "github:apache/cordova-plugin-file-transfer#master",
    "cordova-plugin-geolocation": "^4.0.2",
    "cordova-plugin-googlemaps": "github:mapsplugin/cordova-plugin-googlemaps#multiple_maps",
    "cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.0.0",
    "cordova-plugin-sign-in-with-apple": "^0.1.2",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "jasmine-core": "~3.8.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~3.3.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.9.5",
    "uk.co.workingedge.phonegap.plugin.launchnavigator": "^5.0.5"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-camera": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-plugin-app-version": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-launch-review": {
        "ANDROID_PLAY_SERVICES_CORE_VERSION": "1.8.0"
      },
      "cordova-plugin-sign-in-with-apple": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-geolocation": {
        "GPS_REQUIRED": "true"
      },
      "cordova-plugin-googlemaps": {
        "API_KEY_FOR_ANDROID": "TOKEN",
        "API_KEY_FOR_IOS": "TOKEN"
      },
      "uk.co.workingedge.phonegap.plugin.launchnavigator": {
        "GOOGLE_API_KEY_FOR_ANDROID": "TOKEN",
        "OKHTTP_VERSION": "3.12.0",
        "LOCATION_USAGE_DESCRIPTION": "This app requires access to your location for navigation purposes"
      },
      "com.googlemaps.ios": {}
    },
    "platforms": [
      "browser",
      "ios",
      "android"
    ]
  }

That is my Config.xml:

<widget android-versionCode="16" id="XXXX" version="0.0.17" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <content original-src="index.html" src="http://localhost:8100" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="android-minSdkVersion" value="22" />
    <preference name="android-targetSdkVersion" value="30" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="orientation" value="portrait" />
    <preference name="loadUrlTimeoutValue" value="70000" />
    <preference name="LoadUrlTimeoutValue" value="70000" />
    <preference name="WKWebViewOnly" value="true" />
    <preference name="AndroidLaunchMode" value="singleTask" />
    <preference name="AutoHideSplashScreen" value="true" />
    <preference name="GOOGLE_MAPS_ANDROID_API_KEY" value="TOKEN" />
    <preference name="GOOGLE_MAPS_IOS_API_KEY" value="TOKEN" />
    <platform name="android">
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <application android:networkSecurityConfig="@xml/network_security_config" />
        </edit-config>
        <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
        <config-file parent="./" target="app/src/main/AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
            <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
            <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
        </config-file>
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <preference name="StatusBarOverlaysWebView" value="false" />
        <config-file mode="merge" parent="NSCameraUsageDescription" target="*-Info.plist">
            <string>${PRODUCT_NAME} need camera access to take profile photos.</string>
        </config-file>
        <edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
            <string>${PRODUCT_NAME} need photo library access to get pictures from there.</string>
        </edit-config>
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^4.0.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
    <allow-navigation href="https://localhost:8100" sessionid="0af5d0b7" />
    <allow-navigation href="http://localhost:8100" sessionid="2ff23393" />
</widget>

And, the last, that's my AndroidManifest: image

I'll be on the lookout for possible answers. Thank you to everyone who reads and helps for your attention.

I open the same question on Stackoverflow: https://stackoverflow.com/q/74326508/8478892

lrphael commented 2 years ago

I removed the Android folder and reinstall a several times, and it's work to me.