【发布时间】:2021-07-22 19:41:33
【问题描述】:
我正在构建我的应用程序,但在构建时发生此错误 -
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:checkDebugManifest' (type 'CheckManifest').
- Type 'CheckManifest' property 'manifest' has @Input annotation used on property of type 'File'.
Reason: A property of type 'File' 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.0/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
BUILD FAILED in 1m 0s
我不知道为什么会发生此错误,而之前一切正常。请有人帮我解决这个问题。
【问题讨论】:
-
我从 3 天前就遇到了同样的问题,但我仍然无法解决。
-
@juliosegura 好吧,我刚刚将 grafle 版本降级到 5.4.6 并且它工作正常。虽然我想知道,但如果我们想使用 gradle 版本 7,我们该如何消除这个错误
-
@Shrenyansh 你说得对,我将 gradle 版本降级为 5.6.4 并解决了问题。谢谢!
-
@juliosegura 没问题,兄弟。如果您喜欢我的问题和回答,请考虑点赞。