react-native创建项目错误集锦

错误一:Unable to resolve module 'AccessibilityInfo'

这是因为版本有点高不稳定的原因

卸载旧版


npm uninstall -g react-native-cli
 
npm uninstall -g react-native


安装新版

npm install -g [email protected]
npm install -g [email protected]

创建项目的时候指定版本号

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

错误五:Could not resolve all dependencies for configuration ':app:_debugApk'.

在as中找到File >Settings> Build, Execution, Deployment> Build Tools> Gradle > Android Studio

image.png

勾选此处

错误六:项目初始化红屏的看过来!!!

出现首行报错 Development server returned response error code: 500

https://blog.csdn.net/dengweijunkedafu/article/details/82968159

你可能感兴趣的:(react-native创建项目错误集锦)