Skip to content Skip to sidebar Skip to footer

Could Not Find Runtime.jar (android.arch.lifecycle:runtime:1.0.0)

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 ':debugC

Solution 1:

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()

Solution 2:

For me AIT MANSOUR and Moritz answers didn't work, because I had other dependencies that required jcenter() and jitpack, additionally, for react-native you need the node_modules.

So, my solution for react-native is

allprojects {
    repositories {
        // this is for native modules I'm developing
        mavenLocal()
        // for modules depending on jitpack.io
        maven { url "https://jitpack.io" }
        // add this one
        maven {
            url "https://maven.google.com"
        }
        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
        // keep this at the end
        jcenter()
    }
}

Solution 3:

I solved the problem (at least for me).

It seems that the jcenter has some issues providing the libraries for the project(it may be temporary). As people suggested here, you can solve this by getting those libraries from maven.

Go to your build.gradle file (for ionic devs it is in /platforms/android) and add above every line of code where says jcenter() this line maven { url 'https://maven.google.com' }.

For me it was is two places: buildscript and allprojects. At the end the top of your build.gradle file should look like this:

apply plugin: 'com.android.application'

buildscript {
    repositories {
        maven { url "https://maven.google.com" }
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
    }
}

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

What it does? It just changes the libraries provider(in this case jcenter) with another one so your app can download them successfully. Every line in there is a libraries provider with fallback.

I don't know why it didn't fallback to maven in the first place because the fallback provider was in my build.gradle file.

Solution 4:

This morning I Had the same problem :

Error:Could not resolve all files for configuration ':app:debugAndroidTestRuntimeClasspath'.

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.j

I fixed it this way : On Project repository, i edit build.gradle, i commented jcenter() :

repositories {
   // jcenter()
    maven {
        url "https://maven.google.com"
    }
}

Now the project is building successfully ! Good luck !

Solution 5:

In android/build.gradle, change the code as -

   allprojects {
    repositories {
        mavenLocal()
        maven { url 'https://maven.google.com' }
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

Post a Comment for "Could Not Find Runtime.jar (android.arch.lifecycle:runtime:1.0.0)"