Today I had this prorblem and it got resolved by accepted answewr and by modifying platforms/Android/CordovaLib/build.gradle and moving jcenter()
repository to the bottom.
Now I'm running to another issue when I run my app on the device I get:
[cordova] Android Studio project detected
[cordova] ANDROID_HOME=/opt/android-sdk/
[cordova] JAVA_HOME=/usr/lib/jvm/java-8-openjdk
[cordova] studio
[cordova] > Task :wrapper
[cordova]
[cordova] BUILD SUCCESSFUL in 1s
[cordova] 1 actionable task: 1 executed
[cordova] Subproject Path: CordovaLib
[cordova] Subproject Path: app
[cordova] publishNonDefault is deprecated and has no effect anymore. All variants are now published.
[cordova] Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
[cordova] The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
[cordova] at build_ash13rs4posjmyie3ljokd03j.run(/home/tepo/IdeaProjects/ionic-googlemaps-quickdemo/platforms/android/app/build.gradle:144)
[cordova]
[cordova] FAILURE: Build failed with an exception.
[cordova]
[cordova] * What went wrong:
[cordova] Could not create service of type TaskArtifactStateRepository using TaskExecutionServices.createTaskArtifactStateRepository().
[cordova] > Cannot lock task history cache (/home/tepo/IdeaProjects/ionic-googlemaps-quickdemo/platforms/android/.gradle/4.1/taskHistory) as it has already been locked by this process.
so it seems like by some changes in jcenter
repository (or whatever it is and I really don't care) the cordova build is falling apart.
Anyone been through this? How to proceed?
I need to work not get disturbed by broken tools.
Thanks!