Could not find runtime.jar (android.arch.lifecycle:runtime:1.0.0)

  • A+
Category:Languages

After I am running ionic cordova build android I get this error:

FAILURE: Build failed with an exception.  * What went wrong: Could not resolve all files for configuration ':debugCompileClasspath'. > Could not find runtime.jar (android.arch.lifecycle:runtime:1.0.0).   Searched in the following locations:   https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.jar 

And it is right. When I go to this URL https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.jar I get an 404 Not found error as a JSON.

I don't see any android/ cordova specific versions in that URL so I can't say its from my cordova installation.

Cordova version: 7.1.0

Ionic info:

cli packages: (C:/Users/%User%/AppData/Roaming/npm/node_modules)      @ionic/cli-utils  : 1.19.2     ionic (Ionic CLI) : 3.20.0  global packages:      cordova (Cordova CLI) : not installed // this is strange. I can run cordova in my terminal tho  local packages:      @ionic/app-scripts : 3.1.8     Cordova Platforms  : android 6.4.0     Ionic Framework    : ionic-angular 3.9.2  System:      Android SDK Tools : 26.1.1     Node              : v8.4.0     npm               : 5.3.0     OS                : Windows 10  Environment Variables:      ANDROID_HOME : C:/Users/%User%/AppData/Local/Android/Sdk  Misc:      backend : pro 

Also, I don't have any cordova-android folders in C:/Users/%USER%/.cordova/lib/npm_cache (I don't know if this helps. I saw people talking about this folder)

What's the problem here? Where is that URL coming from? How can I change it and with what can I change it?

If I cannot solve this easily there is one last step to do: remove and install everything again.

Thank you!

 


A quick temporary fix is to include the google maven repo in your top level gradle file.

allprojects {   repositories {       mavenLocal()       maven { url 'https://maven.google.com' } // <-- add this!       jcenter() 

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:1   其中:访客  1   博主  0

    • Syed Anees Ur Rehman Syed Anees Ur Rehman 0

      Just Update your
      goto GradelScript/ build.gradel
      bulid.gradel(project:YOUR_PROJECT_NAME)

      bulid.gradel(project:)

      allprojects {
      repositories {
      mavenLocal()
      maven { url ‘https://maven.google.com’ }
      jcenter()
      }
      }