运行 react-native 运行-android 显示 "build failed with an exception"
Running react-native run-android shows "build failed with an exception"
昨天我可以完美地 运行 android 应用程序,但我不知道为什么,今天早上我做了 react-native 运行-android 就像我所有的日子一样工作,它让我构建失败:
- What went wrong: A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-device-info'.
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
无法在设备上安装应用程序,请阅读上面的错误以了解详细信息。
确保你有一个 Android 模拟器 运行ning 或连接的设备并且有
设置您的 Android 开发环境:
https://facebook.github.io/react-native/docs/getting-started.html
我一直在寻找错误的解决方案,但它们不起作用。我试过的其中一件事是这个但没有解决方案:
chmod 755 android/gradlew
我强调昨天工作正常,是一个很久以前的项目。我认为可能与 sdk 有关,但我不太适应它。有人知道可能是什么吗?在 IOS 中完美运行。
今天同样的问题。我刚刚清理 gradle 缓存并得到了同样的异常。
$ ./gradlew 干净
增量 java 编译是一项孵化功能。
失败:构建失败,出现异常。
- 出了什么问题:
配置项目“:app”时出现问题。
Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-device-info'.
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
此处缺少文件:https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/
// 更新此处找到的解决方案
刚刚在项目 buikd.gradle 上设置:
maven { url 'https://maven.google.com' }
在 jcenter() 之前一切正常。
allprojects { repositories { mavenLocal() maven { url 'https://maven.google.com' } jcenter() maven { url "$rootDir/../node_modules/react-native/android" } } }
来自 https://github.com/rebeccahughes/react-native-device-info/issues/414
昨天我可以完美地 运行 android 应用程序,但我不知道为什么,今天早上我做了 react-native 运行-android 就像我所有的日子一样工作,它让我构建失败:
- What went wrong: A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApk'. A problem occurred configuring project ':react-native-device-info'. 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
无法在设备上安装应用程序,请阅读上面的错误以了解详细信息。 确保你有一个 Android 模拟器 运行ning 或连接的设备并且有 设置您的 Android 开发环境: https://facebook.github.io/react-native/docs/getting-started.html
我一直在寻找错误的解决方案,但它们不起作用。我试过的其中一件事是这个但没有解决方案:
chmod 755 android/gradlew
我强调昨天工作正常,是一个很久以前的项目。我认为可能与 sdk 有关,但我不太适应它。有人知道可能是什么吗?在 IOS 中完美运行。
今天同样的问题。我刚刚清理 gradle 缓存并得到了同样的异常。
$ ./gradlew 干净 增量 java 编译是一项孵化功能。
失败:构建失败,出现异常。
- 出了什么问题:
配置项目“:app”时出现问题。
Could not resolve all dependencies for configuration ':app:_debugApk'. A problem occurred configuring project ':react-native-device-info'. 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
此处缺少文件:https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/
// 更新此处找到的解决方案
刚刚在项目 buikd.gradle 上设置:
maven { url 'https://maven.google.com' }
在 jcenter() 之前一切正常。
allprojects { repositories { mavenLocal() maven { url 'https://maven.google.com' } jcenter() maven { url "$rootDir/../node_modules/react-native/android" } } }
来自 https://github.com/rebeccahughes/react-native-device-info/issues/414