gpt4 book ai didi

android - 构建失败,出现异常 java.io.IOException : Permission denied

转载 作者:太空宇宙 更新时间:2023-11-04 05:32:48 26 4
gpt4 key购买 nike

我正在尝试让 React Native 项目在我的 Linux Mint PC 上运行,但我很难做到这一点,因为我收到以下错误消息:

yarn android
yarn run v1.21.1
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 977 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
/bin/sh: 1: /user/local/Android/Sdk/platform-tools/adb: not found
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...

FAILURE: Build failed with an exception.

* Wh

at went wrong:
java.io.IOException: Permission denied

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

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: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
java.io.IOException: Permission denied

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

at checkExecSyncError (child_process.js:603:11)
at execFileSync (child_process.js:621:15)
at runOnAllDevices (/home/guilherme/Workspace/soccerama/soccerama-mobile-rn/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 977 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...

FAILURE: Build failed with an exception.

* What went wrong:
java.io.IOException: Permission denied

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

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: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
java.io.IOException: Permission denied

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

at checkExecSyncError (child_process.js:603:11)
at execFileSync (child_process.js:621:15)
at runOnAllDevices (/home/guilherme/Workspace/soccerama/soccerama-mobile-rn/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
at buildAndRun (/home/guilherme/Workspace/soccerama/soccerama-mobile-rn/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
at /home/guilherme/Workspace/soccerama/soccerama-mobile-rn/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 (/home/guilherme/Workspace/soccerama/soccerama-mobile-rn/node_modules/@react-native-community/cli/build/index.js:164:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

据我所知,这与 gradle 的权限有关,我尝试了以下方法:

chown -R username ./android/gradlew
chmod 777 -R ./android
chmod +x ./android/gradlew

但这些似乎都不能解决我的问题。如果有人能在这里帮助我,我将不胜感激。

最佳答案

试试这个:

1 - 构建 gradle。如果没有问题,请继续访问应用程序的 android 文件夹。即 c:\folder\app\android

2 - 输入 ./gradlew clean

3 - 运行react-native run-android

关于android - 构建失败,出现异常 java.io.IOException : Permission denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59491833/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com