简体   繁体   English

运行react-native run-android显示“生成失败,出现异常”

[英]Running react-native run-android shows “build failed with an exception”

Yesterday I could run android app perfectly but I don't know why, this morning I did react-native run-android like all days I work and it threw me BUILD FAILED with: 昨天我可以完美地运行android应用,但我不知道为什么,今天早上我像所有工作一样都在做本机运行android,这使我的构建失败:

Could not install the app on the device, read the error above for details. 无法在设备上安装该应用,请阅读上面的错误以获取详细信息。 Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html 确保已运行Android模拟器或已连接设备,并已设置Android开发环境: https : //facebook.github.io/react-native/docs/getting-started.html

I have been searching solutions to the error but they doesn't works. 我一直在寻找错误的解决方案,但它们不起作用。 One of the things I tried was this but with no solution: 我尝试过的其中一件事情是但没有解决方案:

chmod 755 android/gradlew chmod 755安卓/ gradlew

I emphasize that yesterday was working normaly, is a project with so much time ago. 我强调昨天工作正常,是一个时间很久的项目。 I think could be something related with the sdk but I don't move very well with it. 我认为可能与sdk有关,但是我对此并不满意。 Someone know what could be? 有人知道会是什么吗? In IOS works perfectly. 在IOS中完美运行。

Same problem here today. 今天在这里同样的问题。 I just clean gradle cache and got the same exception. 我只是清理gradle缓存,并得到相同的异常。

$ ./gradlew clean Incremental java compilation is an incubating feature. $ ./gradlew clean增量Java编译是一个令人兴奋的功能。

FAILURE: Build failed with an exception. 失败:构建失败,发生异常。

The file is missing here : https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/ 该文件在此处丢失: https : //jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/

// Update solution found here //更新解决方案在这里

Just set on project buikd.gradle : 只需在项目buikd.gradle上设置:

maven { url 'https://maven.google.com' }

Before the jcenter() and everything is OK. jcenter() 之前 ,一切正常。

allprojects { repositories { mavenLocal() maven { url 'https://maven.google.com' } jcenter() maven { url "$rootDir/../node_modules/react-native/android" } } }

from https://github.com/rebeccahughes/react-native-device-info/issues/414 来自https://github.com/rebeccahughes/react-native-device-info/issues/414

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复 React-Native run-android 上的构建失败? - How to Fix Build Failed on React-Native run-android? 修复 React-Native run-android 上的构建失败 - Fix Build Failed on React-Native run-android react-native run-android 失败 - react-native run-android Failed 运行react-native run-android时,任务':react-native-icons:compileReleaseAidl'的执行失败 - Execution failed for task ':react-native-icons:compileReleaseAidl' when running react-native run-android 将okhttp3库与react-native一起使用(运行'react-native run-android'命令时会引发异常) - Using okhttp3 library with react-native (throws an exception when running the command of 'react-native run-android') 运行 react-native run-android 时任务 ':app:transformClassesWithDexForDebug' 执行失败 - Execution failed for task ':app:transformClassesWithDexForDebug' when running react-native run-android 运行 react-native run-android 时出错:build.gradle 中的意外令牌 - Error running react-native run-android: Unexpected Token in build.gradle react-native run-android 失败 M1 - react-native run-android failed M1 react-native run-android:app:installDebug 失败 - react-native run-android :app:installDebug failed react-native运行Android构建由于错误而失败 - react-native run-android build failing because of error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM