我正在开发 react-native android 应用。
我的问题: 今天突然,当我尝试在 Android studio 中运行我的应用程序时出现错误。
是
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 NOT找到了。
请帮我解决问题
最佳答案
要解决提到的错误,您只需在项目 gradle 中调用 jcenter() 上方的 maven url,如下所示:
所有项目{
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()
}
}
关于android - Gradle 构建工具找不到 runtime.jar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50564949/