最新学习ReactNavite,安装的时候就踩了很多坑,写下来帮助其他初学者......
1. Command `run-android` unrecognized. Did you mean to run this inside a react-native project?
执行以下命令行:
npm install -g react-native-cli
npm install --save react-native@latest
2. SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
配置Android SDK环境:
① 添加ANDROID_HOME变量:C:\Users\Administrator\AppData\Local\Android\sdk\platform-tools
② path添加SDK地址:C:\Users\Administrator\AppData\Local\Android\sdk;
3. unable to build react-native app on android device:failed to find target with hash string 'android-23'
Android studio版本非23,在app build.gradle可以手动更改版本