cordova-plugin-googlemaps: Not work for the last cordova version 8.0.0

Im trying a simple cordova project executing the next comands

cordova create map com.map.org Map
cordova platform add browser
cordova platform add android
cordova plugin add cordova-plugin-googlemaps \
    --variable API_KEY_FOR_ANDROID="..." 

i put my api key of course , then when i trie to build android

cordova build android

shows the next error

ap@debian:/opt/ap/www/mapapi$ cordova build android
cp: copyFileSync: could not write to dest file (code=ENOENT):/opt/ap/www/mapapi/platforms/android/res/xml/config.xml

Parsing /opt/ap/www/mapapi/platforms/android/res/xml/config.xml failed
(node:18725) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open '/opt/ap/www/mapapi/platforms/android/res/xml/config.xml'

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 29 (12 by maintainers)

Most upvoted comments

Hi, Fixed mine with the same issue

in your platforms/android/build.gradle

add this maven { url “https://maven.google.com” }

allprojects { repositories { jcenter() maven { url “https://maven.google.com” } } }

Also check your dependencies should be like this:

dependencies { compile fileTree(dir: ‘libs’, include: ‘*.jar’) // SUB-PROJECT DEPENDENCIES START debugCompile(project(path: “CordovaLib”, configuration: “debug”)) releaseCompile(project(path: “CordovaLib”, configuration: “release”)) compile “com.google.android.gms:play-services-maps:11.8.0” compile “com.google.android.gms:play-services-location:11.8.0” // SUB-PROJECT DEPENDENCIES END }

And in your platforms/android/project.properties target=android-26 android.library.reference.1=CordovaLib cordova.system.library.1=com.google.android.gms:play-services-maps:11.8.0 cordova.system.library.2=com.google.android.gms:play-services-location:11.8.0

followed this solution: https://stackoverflow.com/questions/47244237/gradle-failed-to-resolve-com-google-android-gmsplay-services-auth11-6-0?rq=1

So I fixed this by replacing these lines in my build.gradle file:

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
    repositories {
        mavenCentral();
        jcenter()
    }
}

With

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

Now I’m presented with another problem, and I’m working on that.