After upgrading Android Studio, a compilation error occurred: FAILURE: Build completed with 3 failures.

The error message is as follows:

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

Refer to the Internet to find the reason, which is caused by the mismatch between compile Sdk Version and Build Tools Version.

Modify as shown below:

 

Recompile and the problem is solved.

> 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

Reference article: Android Studio Gradle adapts to Android 11. An error occurred in the upgrade_a property of type 'file' annotated with @input ca-CSDN Blog

Guess you like

Origin blog.csdn.net/anfenggang/article/details/131102748