I tried to run the react-native run-android
through my React Project. After that, I got an error like the following.
Starting JS server... Building and installing the app on the device (cd android && gradlew.bat installDebug... FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > Could not resolve all dependencies for configuration ':app:_debugCompile'. > Could not find com.android.support:appcompat-v7:23.0.1. Searched in the following locations: file:/C:/Users/DELL/.m2/repository/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom file:/C:/Users/DELL/.m2/repository/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar file:/F:/Android/react/AwesomeProject/node_modules/react-native/android/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom file:/F:/Android/react/AwesomeProject/node_modules/react-native/android/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.jar Required by: AwesomeProject:app:unspecified AwesomeProject:app:unspecified > com.facebook.react:react-native:0.27.2 > Could not find com.android.support:recyclerview-v7:23.0.1. Searched in the following locations: file:/C:/Users/DELL/.m2/repository/com/android/support/recyclerview-v7/23.0.1/recyclerview-v7-23.0.1.pom file:/C:/Users/DELL/.m2/repository/com/android/support/recyclerview-v7/23.0.1/recyclerview-v7-23.0.1.jar https://jcenter.bintray.com/com/android/support/recyclerview-v7/23.0.1/recyclerview-v7-23.0.1.pom https://jcenter.bintray.com/com/android/support/recyclerview-v7/23.0.1/recyclerview-v7-23.0.1.jar file:/F:/Android/react/AwesomeProject/node_modules/react-native/android/com/android/support/recyclerview-v7/23.0.1/recyclerview-v7-23.0.1.pom file:/F:/Android/react/AwesomeProject/node_modules/react-native/android/com/android/support/recyclerview-v7/23.0.1/recyclerview-v7-23.0.1.jar Required by: AwesomeProject:app:unspecified > com.facebook.react:react-native:0.27.2 > Could not find com.android.support:support-v4:23.1.1. Searched in the following locations: file:/C:/Users/DELL/.m2/repository/com/android/support/support-v4/23.1.1/support-v4-23.1.1.pom file:/C:/Users/DELL/.m2/repository/com/android/support/support-v4/23.1.1/support-v4-23.1.1.jar https://jcenter.bintray.com/com/android/support/support-v4/23.1.1/support-v4-23.1.1.pom https://jcenter.bintray.com/com/android/support/support-v4/23.1.1/support-v4-23.1.1.jar file:/F:/Android/react/AwesomeProject/node_modules/react-native/android/com/android/support/support-v4/23.1.1/support-v4-23.1.1.pom file:/F:/Android/react/AwesomeProject/node_modules/react-native/android/com/android/support/support-v4/23.1.1/support-v4-23.1.1.jar Required by: AwesomeProject:app:unspecified > com.facebook.react:react-native:0.27.2 > com.facebook.fresco:fresco:0.10.0 > com.facebook.fresco:drawee:0.10.0 AwesomeProject:app:unspecified > com.facebook.react:react-native:0.27.2 > com.facebook.fresco:fresco:0.10.0 > com.facebook.fresco:imagepipeline:0.10.0 AwesomeProject:app:unspecified > com.facebook.react:react-native:0.27.2 > com.facebook.fresco:fresco:0.10.0 > com.facebook.fresco:imagepipeline:0.10.0 > com.facebook.fresco:imagepipeline-base:0.10.0 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 17.502 secs 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/android-setup.html
I installed Android SDK and set Android Home and Path Environmental Variable successfully. But I am still getting the same error.
I also installed Gennymotion on my pc for creating virtual android device.
Run your app on the emulator After you have created an Android Virtual Device (AVD), you can start the Android Emulator and run an app in your project: In the toolbar, select the AVD that you want to run your app on from the target device drop-down menu. Click Run.
Just open up the Visual Studio Emulator for Android entry in your Start Menu, hit play, and the emulator is ready to debug from any IDE. Download the standalone emulator today!
If the Android Emulator does not start properly, this problem is often caused by problems with HAXM. HAXM issues are often the result of conflicts with other virtualization technologies, incorrect settings, or an out-of-date HAXM driver. Try reinstalling the HAXM driver, using the steps detailed in Installing HAXM.
You might check the permissions on Android/Gradlew They should be 755 not 644.
Run chmod 755 android/gradlew
inside your app root folder.
Then run react-native run-android
.
And it should work again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With