简体   繁体   English

如何修复错误:processDebugMainManifest DEBUG

[英]How to fix error :processDebugMainManifest DEBUG

I faced this debug while trying to run my own flutter project in device.this is some description:: Execution failed for task ':app:processDebugMainManifest'.我在尝试在设备中运行我自己的 flutter 项目时遇到了这个调试。这是一些描述::任务':app:processDebugMainManifest'的执行失败。

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 @6109445c 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 @6109445c

  • 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 以获得完整的见解。

Can anyone could help me!!谁能帮帮我!!

I just experienced this myself while checking java16 compatibility with Ankidroid (link because it is open source, you can reproduce yourself if you like) .我刚刚在检查 java16 与 Ankidroid 的兼容性时亲身体验了这一点(链接,因为它是开源的,如果你愿意,你可以自己复制)

I would guess you are attempting to use java16 to compile your app?我猜您正在尝试使用 java16 来编译您的应用程序?

As of this writing (April 16, 2021) Android Gradle Plugin is not compatible with java16 - not 4.1.3, 4.2.0-rc01 nor 7.0.0alpha14 (all the current versions as I write this.在撰写本文时(2021 年 4 月 16 日)Android Gradle 插件与 java16 不兼容 - 不是 4.1.3、4.2.0-rc01 也不是 7.0.0alpha14(我写这篇文章时的所有当前版本。

If you use java8 or java11 it works.如果你使用 java8 或 java11 它可以工作。

Android Studio uses java11 internally now for 4.2.x so that is the safest bet at this point for Android development. Android Studio 现在在内部使用 java11 用于 4.2.x,因此对于 Android 开发来说,这是目前最安全的选择。

I have logged this upstream issue so Google is aware, and others may track it in case there is a good workaround/explanation/reason https://issuetracker.google.com/u/1/issues/186806275我已经记录了这个上游问题,所以谷歌知道,如果有一个好的解决方法/解释/原因https://issuetracker.google.com/u/1/issues/186806275 ,其他人可能会跟踪它

Solved same issue with following commands使用以下命令解决了相同的问题

cd /Applications/Android\ Studio.app/Contents/jre

ln -s ../jre jdk

ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk

flutter doctor -v

Clean and run it will work.清理并运行它会工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM