出错信息如下:
Executing tasks: [:app:assembleDebug] in project D:\AndroidStudioProjects\checkinsys
> Task :app:preBuild UP-TO-DATE
> Task :identify:preBuild UP-TO-DATE
> Task :identify:preDebugBuild UP-TO-DATE
> Task :identify:checkDebugManifest FAILED
> Task :identify:compileDebugAidl NO-SOURCE
> Task :identify:packageDebugRenderscript NO-SOURCE
> Task :app:prepareLintJar UP-TO-DATE
> Task :identify:compileDebugRenderscript NO-SOURCE
> Task :identify:generateDebugResValues UP-TO-DATE
> Task :identify:generateDebugResources UP-TO-DATE
> Task :identify:packageDebugResources UP-TO-DATE
> Task :identify:prepareLintJar UP-TO-DATE
> Task :identify:javaPreCompileDebug UP-TO-DATE
> Task :identify:mergeDebugShaders UP-TO-DATE
> Task :identify:compileDebugShaders FAILED
> Task :identify:processDebugJavaRes NO-SOURCE
> Task :identify:mergeDebugJniLibFolders UP-TO-DATE
> Task :identify:transformNativeLibsWithMergeJniLibsForDebug FAILED
FAILURE: Build completed with 3 failures.
1: Task failed with an exception.
-----------
* What went wrong:
A problem was found with the configuration of task ':identify:checkDebugManifest' (type 'CheckManifest').
- In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.internal.tasks.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.2/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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem was found with the configuration of task ':identify:compileDebugShaders' (type 'ShaderCompile').
- In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.tasks.ShaderCompile' property 'sourceDir' is annotated with @InputFiles but missing a normalization strategy.
Reason: If you don't declare the normalization, outputs can't be re-used between machines or locations on the same machine, therefore caching efficiency drops significantly.
Possible solution: Declare the normalization strategy by annotating the property with either @PathSensitive, @Classpath or @CompileClasspath.
Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#missing_normalization_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.
==============================================================================
3: Task failed with an exception.
-----------
* What went wrong:
Some problems were found with the configuration of task ':identify:transformNativeLibsWithMergeJniLibsForDebug' (type 'TransformTask').
- In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.internal.pipeline.TransformTask' property 'allSecondaryInputs' is private and annotated with @Internal.
Reason: Annotations on private getters are ignored.
Possible solutions:
1. Make the getter public.
2. Annotate the public version of the getter.
Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#private_getter_must_not_be_annotated for more details about this problem.
- In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.internal.pipeline.TransformTask' property 'logging' is missing an input or output annotation.
Reason: A property without annotation isn't considered during up-to-date checking.
Possible solutions:
1. Add an input or output annotation.
2. Mark it as @Internal.
Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#missing_annotation for more details about this problem.
- In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.internal.pipeline.TransformTask' property 'oldSecondaryInputs' is annotated with @InputFiles but missing a normalization strategy.
Reason: If you don't declare the normalization, outputs can't be re-used between machines or locations on the same machine, therefore caching efficiency drops significantly.
Possible solution: Declare the normalization strategy by annotating the property with either @PathSensitive, @Classpath or @CompileClasspath.
Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#missing_normalization_annotation for more details about this problem.
- In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.internal.pipeline.TransformTask' property 'path' is missing an input or output annotation.
Reason: A property without annotation isn't considered during up-to-date checking.
Possible solutions:
1. Add an input or output annotation.
2. Mark it as @Internal.
Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#missing_annotation for more details about this problem.
- In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.internal.pipeline.TransformTask' property 'temporaryDir' is missing an input or output annotation.
Reason: A property without annotation isn't considered during up-to-date checking.
Possible solutions:
1. Add an input or output annotation.
2. Mark it as @Internal.
Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#missing_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.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
10 actionable tasks: 3 executed, 7 up-to-date
网上参考,查找原因,是compile Sdk Version与Build Tools Version不匹配导致。
按下图修改:
重新编译,问题解决。
> Task :prepareKotlinBuildScriptModel UP-TO-DATE
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.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 3s文章来源:https://www.toymoban.com/news/detail-774759.html
参考文章:Android Studio Gradle 适配 Android 11 升级出错了_a property of type 'file' annotated with @input ca-CSDN博客文章来源地址https://www.toymoban.com/news/detail-774759.html
到了这里,关于Android Studio升级后,编译出错FAILURE: Build completed with 3 failures.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!