Fix: conflict with OneSignal-Cordova-SDK
MODIFY
package.json
package.json
},
{
"name": "cordova-ios",
- "version": ">=4.9.0"
+ "version": ">=4.5.0"
},
{
"name": "apple-xcode",
"cordova-js": "^4.2.4",
"eslint": "^5.7.0",
"jest": "^23.6.0"
+ },
+ "dependencies": {
+ "cordova-common": "^3.1.0"
}
}

MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.6.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.6.1-beta-20190423-1048" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="Promise" src="www/Promise.js" />
<asset src="www/promise-7.0.4.min.js.map" target="promise-7.0.4.min.js.map" />
</array>
</config-file>
- <framework src="GoogleMaps" type="podspec" spec="~> 3.1.0" />
+ <preference name="GOOGLE_MAPS_SDK_FOR_IOS_VERSION" default="3.1.0"/>
+ <framework src="GoogleMaps" type="podspec" spec="~> ${GOOGLE_MAPS_SDK_FOR_IOS_VERSION}" />
<hook type="before_platform_add" src="src/ios/check_sdk_version.js"/>
<hook type="before_plugin_install" src="src/ios/check_sdk_version.js"/>

MODIFY
src/android/frameworks/apikey.gradle
src/android/frameworks/apikey.gradle
@@ -12,7 +12,6 @@ android {
}
}
-
if (finalConfigXmlFile == null) {
throw new GradleException("Could not read config.xml file.")
}
@@ -35,14 +34,18 @@ android {
}
}
+
if (found == 0) {
throw new GradleException("You need to declare GOOGLE_MAPS_ANDROID_API_KEY in config.xml.")
}
- defaultConfig {
- manifestPlaceholders = [
- GOOGLE_MAPS_ANDROID_API_KEY: props.getProperty("GOOGLE_MAPS_ANDROID_API_KEY")
- ]
+ buildTypes {
+ debug {
+ manifestPlaceholders.GOOGLE_MAPS_ANDROID_API_KEY = props.getProperty("GOOGLE_MAPS_ANDROID_API_KEY")
+ }
+ release {
+ manifestPlaceholders.GOOGLE_MAPS_ANDROID_API_KEY = props.getProperty("GOOGLE_MAPS_ANDROID_API_KEY")
+ }
}
}

Fix: conflict with OneSignal-Cordova-SDK
https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/2604
https://github.com/OneSignal/OneSignal-Cordova-SDK/issues/503