且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当我尝试运行 react-native run-android 命令时出错

更新时间:2022-06-17 05:48:41

您的 SDK 路径不正确,需要在以下文件中添加正确的路径:萨项目 >安卓 >local.properties

Your SDK path is not correct you need to add a correct path in the below file: sa project > android > local.properties

添加如下示例的路径:

sdk.dir = /Users/admin/Library/Android/sdk

添加后使用以下命令:

1. cd android/
2. ./gradlew clean
3. cd ..
4. Command: react-native bundle --platform android --dev false --entry-file indexcsasa.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
csacs
5. react-native run-android