javascript - react-native android genymotion
PHPz
PHPz 2017-04-11 09:51:10
[JavaScript讨论组]

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

PHPz
PHPz

学习是最好的投资!

全部回复(2)
天蓬老师

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

ringa_lee

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

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号