java - 升级 gradle 时,Flutter 项目无法构建。错误 : Type 'FlutterTask' property 'assets' is missing an input or output annotation

标签 java android flutter gradle

关闭。这个问题需要debugging details .它目前不接受答案。












编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将帮助其他人回答问题。


去年关闭。







Improve this question




当我尝试在 USB 设备上构建我的应用程序时,构建崩溃并显示此日志输出

FAILURE: Build failed with an exception.

  • What went wrong: Some problems were found with the configuration of task ':app:compileFlutterBuildDebug' (type 'FlutterTask').

  • 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

BUILD FAILED in 1s Exception: Gradle task assembleDebug failed with exit code 1


请帮助找到解决此问题的方法

最佳答案

发生这种情况是因为您将项目中的 gradle 更新为 gradle 7。并且 gradle 7 有一些新的注释属性,必须进行审查。
我也遇到了这个问题,并在 github 上提出了一个问题。
This is the link
所以你的选择

  • 降级你的 gradle( < 7 )
  • 按照 this 中的说明进行更改公关。

  • 在引用的页面(Pull Req)中。有一段名为 Files Changed .看到那边的绿色线条。只需编辑您的 gradle文件和添加/编辑与绿色线条相同。

    关于java - 升级 gradle 时,Flutter 项目无法构建。错误 : Type 'FlutterTask' property 'assets' is missing an input or output annotation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67137816/

    相关文章:

    flutter - 在抖动中使用GestureDetector移动旋转的图像

    flutter - SingleChildScrollView不可滚动

    android - Flutter-来自Firebase的readData()导致该方法在null上被调用

    java - 为 jpa 实体配置 ehcache.xml 还是使用注释?

    java - 使用 deeplearning4j 训练简单的神经网络

    java - 消息气泡自定义绘图

    android - 为什么应用程序有时会在 killProcess 上重新启动?

    android - 我是否需要每帧都在 Canvas 上重绘所有对象?

    java - 如何在不使用非 api 类的情况下取消 Java 中的 Files.copy() ?

    Java 回文程序(我走上正轨了吗)?