Android Studio升级后,编译出错FAILURE: Build completed with 3 failures.

出错信息如下:

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

参考文章:Android Studio Gradle 适配 Android 11 升级出错了_a property of type 'file' annotated with @input ca-CSDN博客

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值