Gradle构建工具找不到runtime.jar?

时间:2018-05-28 11:05:39

标签: android reactjs android-studio react-native bintray

我正在开发react-native android app。

我的问题: 今天突然,当我试图在Android工作室中运行我的应用程序时出现错误。

Error: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

我没有更改gradle文件中的任何内容,但突然出现了。但我以前的项目工作正常。

当我运行url: https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.jar时,它显示我404未找到。

请帮我解决问题

1 个答案:

答案 0 :(得分:4)

要解决上述错误,您只需在项目gradle中调用jcenter()上方的maven url,如下所示:

allprojects {

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

    }
}