cordova-plugin-googlemaps: conflict with OneSignal-Cordova-SDK

I’m submitting a … (check one with “x”)

  • question
  • any problem or bug report

OS: (check one with “x”)

  • Android
  • iOS
  • Browser

cordova information: (run $> cordova plugin list)

[root@code mobile-user]# cordova plugin list
cordova-plugin-android-permissions 1.0.0 "Permissions"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-apprate 1.4.0 "AppRate"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-globalization 1.11.0 "Globalization"
cordova-plugin-googlemaps 2.6.0 "cordova-plugin-googlemaps"
cordova-plugin-inappbrowser 1.7.2 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.0.1 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-request-location-accuracy 2.2.3 "Request Location Accuracy"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova.plugins.diagnostic 4.0.12 "Diagnostic"
onesignal-cordova-plugin 2.4.6 "OneSignal Push Notifications"

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": "^4.4.0"
"@ionic-native/google-maps": "^4.15.1" : 

Current behavior: Can not build for android (tried with cordova android 7 and 8) I am getting GOOGLE_MAPS_ANDROID_API_KEY not provided, while I added preferences values to config.xml <preference name="GOOGLE_MAPS_ANDROID_API_KEY" value="***" /> <preference name="GOOGLE_MAPS_IOS_API_KEY" value="***" />

Expected behavior: To build android apk successfully

Related code, data or error log (please format your code or data): BUILD FAILED in 10s /root/projects/busvibe/mobile-user/platforms/android/gradlew: Command failed with exit code 1 Error output: Note: /root/projects/busvibe/mobile-user/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /root/projects/busvibe/mobile-user/platforms/android/app/src/main/AndroidManifest.xml:12:66-112 Error: Attribute meta-data#com.google.android.geo.API_KEY@value at AndroidManifest.xml:12:66-112 requires a placeholder substitution but no value for <GOOGLE_MAPS_ANDROID_API_KEY> is provided. /root/projects/busvibe/mobile-user/platforms/android/app/src/main/AndroidManifest.xml Error: Validation failed, exiting

FAILURE: Build failed with an exception.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Just for info if anyone need, I was having the same issue even following the instructions here.

Installing "cordova-plugin-googlemaps" for ios
"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.
cordova-plugin-googlemaps depends on GoogleMaps@~> 2.7.0, which conflicts with another plugin. GoogleMaps@~> 3.1.0 is already installed and was not overwritten.
Running command: pod install --verbose
Failed to install 'cordova-plugin-googlemaps': Error: pod: Command failed with exit code 31
    at ChildProcess.whenDone (/Projetos/appautonomo/src/node_modules/cordova-common/src/superspawn.js:125:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
pod: Command failed with exit code 31

Then I tried to run pod install --verbose and the console log:

$ pod install --verbose
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Parana Servicos`: (``)

Finding Podfile changes
  A GoogleMaps
  - AeroGear-Push

Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "GoogleMaps":
  In Podfile:
    GoogleMaps (~> 3.1.0)

None of your spec sources contain a spec satisfying the dependency: `GoogleMaps (~> 3.1.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

So, following the instruction I updated with pod repo update and it worked! To ensure, I removed the plugin and added again:

Installing "cordova-plugin-googlemaps" for ios
"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.
cordova-plugin-googlemaps depends on GoogleMaps@~> 2.7.0, which conflicts with another plugin. GoogleMaps@~> 3.1.0 is already installed and was not overwritten.
Running command: pod install --verbose
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                    Dload  Upload   Total   Spent    Left  Speed

     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
     0 54.7M    0  104k    0     0   371k      0  0:02:30 --:--:--  0:02:30  370k
     9 54.7M    9 5151k    0     0  4031k      0  0:00:13  0:00:01  0:00:12 4031k
    17 54.7M   17 9663k    0     0  4243k      0  0:00:13  0:00:02  0:00:11 4242k
    22 54.7M   22 12.2M    0     0  3832k      0  0:00:14  0:00:03  0:00:11 3831k
    26 54.7M   26 14.3M    0     0  3288k      0  0:00:17  0:00:04  0:00:13 3288k
    27 54.7M   27 14.8M    0     0  2839k      0  0:00:19  0:00:05  0:00:14 2976k
    28 54.7M   28 15.4M    0     0  2511k      0  0:00:22  0:00:06  0:00:16 2124k
    29 54.7M   29 16.2M    0     0  2291k      0  0:00:24  0:00:07  0:00:17 1403k
    31 54.7M   31 17.1M    0     0  2119k      0  0:00:26  0:00:08  0:00:18  996k
    33 54.7M   33 18.4M    0     0  2030k      0  0:00:27  0:00:09  0:00:18  856k
    36 54.7M   36 20.0M    0     0  2001k      0  0:00:27  0:00:10  0:00:17 1091k
    43 54.7M   43 24.0M    0     0  2184k      0  0:00:25  0:00:11  0:00:14 1771k
    51 54.7M   51 28.2M    0     0  2358k      0  0:00:23  0:00:12  0:00:11 2456k
    57 54.7M   57 31.7M    0     0  2446k      0  0:00:22  0:00:13  0:00:09 2986k
    61 54.7M   61 33.8M    0     0  2423k      0  0:00:23  0:00:14  0:00:09 3149k
    70 54.7M   70 38.8M    0     0  2601k      0  0:00:21  0:00:15  0:00:06 3833k
    76 54.7M   76 42.0M    0     0  2641k      0  0:00:21  0:00:16  0:00:05 3670k
    81 54.7M   81 44.7M    0     0  2653k      0  0:00:21  0:00:17  0:00:04 3379k
    87 54.7M   87 47.8M    0     0  2679k      0  0:00:20  0:00:18  0:00:02 3296k
    92 54.7M   92 50.8M    0     0  2700k      0  0:00:20  0:00:19  0:00:01 3495k
   100 54.7M  100 54.7M    0     0  2773k      0  0:00:20  0:00:20 --:--:-- 3307k


      Official document https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.3.0/README.md Please consider to buy a beer for us 🍺 https://github.com/mapsplugin/cordova-plugin-googlemaps#buy-us-a-beer

Adding cordova-plugin-googlemaps to package.json

Thanks!

Since cordova-ios@4.4 or below specifies platform :ios, '8.0' in platforms/ios/Podfile, you can not use GoogleMaps@3.x Pod. Because Google drops supports.

However cordova-ios@4.4 or below versions are still active in many projects. That’s why I specified two ways.

https://github.com/mapsplugin/cordova-plugin-googlemaps/blob/a5155cd34f0ea02b2ee4d37177504a4bdb5d5cca/plugin.xml#L474-L482

 <framework src="GoogleMaps" type="podspec" spec="~> 2.7.0" />

works for cordova-ios@4.4 or below versions.

    <podspec>
      <config>
        <source url="https://github.com/CocoaPods/Specs.git"/>
      </config>
      <pods>
        <pod name="GoogleMaps" spec="~> 3.1.0"/>
      </pods>
    </podspec>

works for cordova-ios@5.x with cordova-cli@9.


cordova-plugin-googlemaps depends on GoogleMaps@~> 2.7.0, 
which conflicts with another plugin.
GoogleMaps@~> 3.1.0 is already installed and was not overwritten.

As the message, GoogleMaps@~> 3.1.0 is already.