直接从现有的项目中react-native run-android报错信息如下
Building and installing the app on the device (cd android && ./gradlew installDebug)...
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/getting-started.html
解决思路:
- 首先考虑到的应该是build的配置跟提交人的配置不一致导致的
- 确保android环境已经配置好,官方的
react-native init AwesomeProject可以运行 - 删掉android/local.properties别人的配置文件
- 参照AwesomeProject的例子修改以下文件如图1,项目目录下手动执行
cd android && ./gradlew installDebug试一试,如果有权限问题:chmod +x gradlew,正常的会如下图2所示
图1
图2

