react-native android genymotion

发布于 2022-09-02 14:12:24 字数 5156 浏览 31 评论 0

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

图片描述

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

猫七 2022-09-09 14:12:24

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

宣告ˉ结束 2022-09-09 14:12:24

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文