android - React 本机 android 应用程序构建未在 Mac 上运行
问题描述
当我尝试在 Mac 上运行它时,我已经在 Windows 上构建了一个反应本机应用程序,它给了我一个错误。只有当我尝试运行 android 时它才会显示这个错误,ios 运行完美。在我在 Mac 上构建它之后,即使在它之前编码的 Windows 系统中它也不会运行。
错误:-
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: spawnSync ./gradlew EACCES
at Object.spawnSync (internal/child_process.js:1041:20)
at spawnSync (child_process.js:607:24)
at execFileSync (child_process.js:634:15)
at runOnAllDevices (/Users/ideenkreise/Documents/GoalMate/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
at buildAndRun (/Users/ideenkreise/Documents/GoalMate/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
at /Users/ideenkreise/Documents/GoalMate/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (/Users/ideenkreise/Documents/GoalMate/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:164:9)
解决方案
您无权执行 ./gradle
在项目根目录下运行以下命令
chmod 755 安卓/gradlew
推荐阅读
- javascript - 如何使用 reduce() JavaScript 找到多个最大尺寸
- python - Functions and condition statements
- javascript - JavaScript - Get the Date of the next Day of the Week (For each day)
- java - 如何制作可以在屏幕外运行的 Android 警报应用程序?
- android - 在android应用程序中使用ksoap从asp.net webservice中消费对象列表
- ios - Is it necessary to have restore code paymentQueueRestoreCompletedTransactionsFinished()?
- python-3.x - python3从文本文件中查找信息
- vba - How do I programmatically protect a Word Document from a UserForm CommandButton?
- redis - Redis主从通信的内部实现是什么?
- postgresql - Postgres 作业在针对默认 postgres 数据库以外的数据库执行时失败