[英]i got this error Execution failed for task :app:processDebugMainManifest while running with npm run android but with android studio it works fine
react-native run-android
react-native run-android
info Running jetifier to migrate libraries to AndroidX. info 运行 jetifier 将库迁移到 AndroidX。 You can disable it using "--no-jetifier" flag.
您可以使用“--no-jetifier”标志禁用它。 Jetifier found 870 file(s) to forward-jetify.
Jetifier 找到 870 个文件来转发-jetify。 Using 8 workers... info JS server already running.
使用 8 个工人... info JS 服务器已经在运行。 npm:load Completed in 18ms info Installing the app...
npm:load Completed in 18ms info 安装应用程序...
Task:app:processDebugMainManifest FAILED FAILURE: Build failed with an exception.
Task:app:processDebugMainManifest FAILED FAILURE:构建失败并出现异常。
Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @5e15465d
Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @5e15465d
Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.
使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.
运行 --scan 以获得完整的见解。
Get more help at https://help.gradle.org在https://help.gradle.org获得更多帮助
BUILD FAILED in 2s 2 秒内构建失败
error Failed to install the app.错误 无法安装应用程序。 Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup .
确保您已设置 Android 开发环境: https://reactnative.dev/docs/environment-setup 。 Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/ repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
FAILURE: Build failed with an exception. FAILURE:构建失败并出现异常。
Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @5e15465d
Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @5e15465d
Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.
使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.
运行 --scan 以获得完整的见解。
Get more help at https://help.gradle.org在https://help.gradle.org获得更多帮助
BUILD FAILED in 2s 2 秒内构建失败
at makeError (/Users/arbazshaikh/Desktop/authentication/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
at /Users/arbazshaikh/Desktop/authentication/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/arbazshaikh/Desktop/authentication/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/arbazshaikh/Desktop/authentication/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details. info 使用 --verbose 标志运行 CLI 以获取更多详细信息。
i don't know if its related to Mac M1 chip我不知道它是否与Mac M1芯片有关
Finally i found solution for this.. My JDK version was 17. still don't know why JDK 17 gave error after sometime.最后我找到了解决方案。我的 JDK 版本是 17。仍然不知道为什么 JDK 17 在一段时间后会出错。 Now i downgraded to JDK 14 and now works fine!!!
现在我降级到 JDK 14,现在可以正常工作了!!! Hope this helps
希望这可以帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.