版权声明:请通知博主([email protected])获取允许后进行分享。 https://blog.csdn.net/qq934235475/article/details/85110180
RN在IOS运行一切正常,准备去Android端测试发现报错,但是我设备启着的,于是乎根据提示./gradlew installDebug,却说我Permission denied
造成原因:gradlew权限不足导致react-native run-android失败。
解决方案:
执行如下命令:
chmod +x gradlew
错误截图:
错误:安卓运行后报错,在android/app/src/main/下创建assets文件夹,运行如下脚本即可。
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
错误:如果此后第一次运行可以启动,双击R时不显示。
我虚拟机之前抓包连接了代理服务器,关掉即可,供参考。