加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

react native 错误:Make sure you have an Android emulator ru

发布时间:2020-12-15 03:28:52 所属栏目:百科 来源:网络整理
导读:最近研究 react native ,在mac 上配置android 环境时,遇到一个问题: 在执行 react native run-android 时报错: react native 错误: Could not install the app on the device,read the error above for details. Make sure you have an Android emulato

最近研究 react native ,在mac 上配置android 环境时,遇到一个问题:

在执行 react native run-android 时报错:

react native 错误:
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


查了好多解决方案:最后找到一个有效的,记录下:

中文

我找到解决方法了
首先 确定 是用 brew install android-sdk
安装后 会在 /usr/local/Cellar/android-sdk 这个目录
同时 /usr/local/var/lib/android-sdk 这个目录也会存在一部分 源
前者 一部分 以 link 后者的
最后 要把 前者目录里的 platform-tools build-tools 拷贝到 /usr/local/var/lib/android-sdk
ANDROID_HOME=/usr/local/var/lib/android-sdk

react-native run-android

English

I found a solution
First determine with brew install android-sdk
In / usr / local / Cellar / android-sdk directory after installation
While / usr / local / var / lib / android-sdk directory will be present as part of the source
In the latter part of the former link
Finally,should the former platform-tools build-tools copied to / usr / local / var / lib / android-sdk
ANDROID_HOME = / usr / local / var / lib / android-sdk
it’s ok


解决方案参考地址
react native 配置教程

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读