react-native android genymotion

mac 下 搭建 react-native android 开发环境

react-native run-android

想知道 run 之后 就会找 genymotion模拟器

$ react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> failed to find Build Tools revision 23.0.1

* 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: 2.478 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

安装 Build Tools revision 23.0.1

运行如下


$ react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew 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:/Users/julaud/.m2/repository/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom
         file:/Users/julaud/.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:/Users/julaud/www/Frontend/javascript/react/react-native/AwesomeProject/node_modules/react-native/android/com/android/support/appcompat-v7/23.0.1/appcompat-v7-23.0.1.pom
         file:/Users/julaud/www/Frontend/javascript/react/react-native/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.24.1
   > Could not find com.android.support:recyclerview-v7:23.0.1.
     Searched in the following locations:
         file:/Users/julaud/.m2/repository/com/android/support/recyclerview-v7/23.0.1/recyclerview-v7-23.0.1.pom
         file:/Users/julaud/.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:/Users/julaud/www/Frontend/javascript/react/react-native/AwesomeProject/node_modules/react-native/android/com/android/support/recyclerview-v7/23.0.1/recyclerview-v7-23.0.1.pom
         file:/Users/julaud/www/Frontend/javascript/react/react-native/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.24.1
   > Could not find com.android.support:support-v4:21.0.3.
     Searched in the following locations:
         file:/Users/julaud/.m2/repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom
         file:/Users/julaud/.m2/repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar
         https://jcenter.bintray.com/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom
         https://jcenter.bintray.com/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar
         file:/Users/julaud/www/Frontend/javascript/react/react-native/AwesomeProject/node_modules/react-native/android/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom
         file:/Users/julaud/www/Frontend/javascript/react/react-native/AwesomeProject/node_modules/react-native/android/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar
     Required by:
         AwesomeProject:app:unspecified > com.facebook.react:react-native:0.24.1 > com.facebook.fresco:fresco:0.8.1 > com.facebook.fresco:imagepipeline:0.8.1
         AwesomeProject:app:unspecified > com.facebook.react:react-native:0.24.1 > com.facebook.fresco:fresco:0.8.1 > com.facebook.fresco:drawee:0.8.1
* 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: 9.433 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

图片描述

阅读 6.3k
2 个回答

1.adb devices看下有没有在线的设备
2.执行react-native start运行打包服务器没?

你这报错不是genymotion的问题,而是Build Tools revision 23.0.1 你没有该版本所致。
另外只要你打开了genymotion模拟器,run之后就会自动寻找该模拟器,并安装。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题