0

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!

greengold
  • 1,184
  • 3
  • 18
  • 43

1 Answers1

3

I had the same problem occur to me after a build failed because /var/ was full. Some lock files appear to be left in your user directory, leading to the error you're seeing.

You can remove them all by running find ~/.gradle -type f -name "*.lock" | xargs rm

You then need to clear your android platform. The easiest way is to run cordova platform rm android && rm -r platforms/android ; cordova platform add android

Now you should be able to compile (at least I could). Hope this helps.

Anonymous
  • 31
  • 1