HarmonyOS 鸿蒙Next DevEco Studio 构建运行程序时出错,报错如下,麻烦各位大佬帮忙看看,旧版本运行的好好的,卸载DevEco Studio 软件安装新版本的DevEco Studio 以后运行报错

发布于 1周前 作者 vueper 来自 鸿蒙OS

HarmonyOS 鸿蒙Next DevEco Studio 构建运行程序时出错,报错如下,麻烦各位大佬帮忙看看,旧版本运行的好好的,卸载DevEco Studio 软件安装新版本的DevEco Studio 以后运行报错

Executing tasks: [:main:assembleDebug] in project F:\hms-health-device-fa-mzy\OpenHealthEcologyFA

> Task :OhosKit:preBuild

> Task :OhosKit:compileDebugIdl NO-SOURCE

> Task :OhosKit:preDebugBuild

> Task :OhosKit:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:

Some problems were found with the configuration of task ':OhosKit:mergeDebugResources' (type 'MergeResources').

- In plugin 'com.huawei.ohos.build.plugins.VersionCheckPlugin' type 'com.huawei.ohos.build.tasks.MergeResources' property 'dependencyResources' has @Input annotation used on property of type 'FileCollection'.

  Reason: A property of type 'FileCollection' annotated with @Input cannot determine how to interpret the file.

  Possible solutions:
  1. Annotate with @InputFile for regular files.
  2. Annotate with @InputDirectory for directories.
  3. If you want to track the path, return File.absolutePath as a String and keep @Input.

  Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#incorrect_use_of_input_annotation for more details about this problem.

- In plugin 'com.huawei.ohos.build.plugins.VersionCheckPlugin' type 'com.huawei.ohos.build.tasks.MergeResources' property 'projectResources' has @Input annotation used on property of type 'FileCollection'.

  Reason: A property of type 'FileCollection' annotated with @Input cannot determine how to interpret the file.

  Possible solutions:
  1. Annotate with @InputFile for regular files.
  2. Annotate with @InputDirectory for directories.
  3. If you want to track the path, return File.absolutePath as a String and keep @Input.

  Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#incorrect_use_of_input_annotation for more details about this problem.

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 769ms

3 actionable tasks: 3 executed

更多关于HarmonyOS 鸿蒙Next DevEco Studio 构建运行程序时出错,报错如下,麻烦各位大佬帮忙看看,旧版本运行的好好的,卸载DevEco Studio 软件安装新版本的DevEco Studio 以后运行报错的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html

4 回复

发一下DevEvo Studio版本,工程根目录有build.gradle文件,看下里面的构建工具版本是不是低了。

可以参照这个文档查看对应的构建工具底座版本:https://developer.huawei.com/consumer/cn/forum/topic/0202434994822360101?fid=26

更多关于HarmonyOS 鸿蒙Next DevEco Studio 构建运行程序时出错,报错如下,麻烦各位大佬帮忙看看,旧版本运行的好好的,卸载DevEco Studio 软件安装新版本的DevEco Studio 以后运行报错的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


可以截图看一下工程级的build.gradle里的dependencies配置,应该是插件版本比较老,需要换成基于Gradle 7以上的插件,可以新建工程对比一下。

开发者您好,相关问题已经反馈给工作人员,稍后会再次回复您,感谢您对华为开发者论坛的支持。

针对您提到的HarmonyOS(鸿蒙)系统中DevEco Studio在新版本构建运行程序时出错的问题,这里提供一些可能的解决方向,但不涉及Java或C语言相关内容:

  1. 检查环境配置:确保您的开发环境(如SDK版本、NDK版本等)与新版本的DevEco Studio兼容。有时新版本的开发工具会要求更新或特定的环境配置。

  2. 清理项目:尝试在DevEco Studio中清理并重建项目。这可以解决因旧构建缓存导致的问题。

  3. 检查gradle配置:查看build.gradle文件,确保所有依赖项都是最新的,并且与新版本的DevEco Studio兼容。

  4. 查看错误日志:详细分析报错信息,特别是堆栈跟踪部分,这可能会提供关于哪个组件或配置出错的线索。

  5. 回退版本:如果问题持续存在,考虑暂时回退到旧版本的DevEco Studio,确保开发进度不受影响,同时等待官方更新或社区反馈。

  6. 查阅官方文档:访问HarmonyOS官方文档或DevEco Studio的更新日志,查看是否有关于此问题的说明或已知问题列表。

如果问题依旧没法解决请联系官网客服, 官网地址是 https://www.itying.com/category-93-b0.html

回到顶部