简体   繁体   中英

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:

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

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

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. Someone know what could be? In IOS works perfectly.

Same problem here today. I just clean gradle cache and got the same exception.

$ ./gradlew clean Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

The file is missing here : https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/

// Update solution found here

Just set on project buikd.gradle :

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

Before the jcenter() and everything is OK.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM