react-native创建项目错误集锦
2018-08-17 本文已影响16人
悦者生存
错误一:Unable to resolve module 'AccessibilityInfo'
这是因为版本有点高不稳定的原因
卸载旧版
npm uninstall -g react-native-cli
npm uninstall -g react-native
安装新版
npm install -g react-native@0.55.4
npm install -g react-native-cli@1.2.0
创建项目的时候指定版本号
react-native init --version="0.55.4" myFirstApp
错误二:链接夜神浏览器失败
找到本机sdk的位置
比如我的sdk在
D:\Android\Sdk\platform-tools
进入到这个里面
在命令行里输入adb connect 127.0.0.1:62001
就可以了
错误三:
eact 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:
这是因为在找不到sdk位置报的错误
把local.properties文件(就是指定sdk位置)的文件放到android目录下面
在环境变量里面指定Android_Home环境变量
错误四:
react native生成APP报错:You have not accepted the license agreements of the following SDK components:]
https://www.cnblogs.com/qiyecao/p/9511216.html