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

这篇具有很好参考价值的文章主要介绍了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不匹配导致。

按下图修改:

in plugin 'com.android.build.gradle.api.androidbaseplugin' type 'com.android,android,android studio,gradle 

重新编译,问题解决。

> 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博客文章来源地址https://www.toymoban.com/news/detail-774759.html

到了这里,关于Android Studio升级后,编译出错FAILURE: Build completed with 3 failures.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Android新项目出错Could not resolve com.android.tools.build:aapt2***

    本人遇到的解决办法: 1、修改项目根目录下的build.gradle文件里下面的版本号 将以上两个的版本号对应改好。具体两个版本号的对应关系,请参看下面的这个博客地址 Android Gradle插件对应的Gradle所需版本_帅次的博客-CSDN博客_gradle版本号对应的版本  

    2024年02月15日
    浏览(65)
  • Visual Studio 编译项目出错:错误 MSB4018 “GenerateStaticWebAsssetsPropsFile”任务意外失败

    最近因VS2022从V16升级到版本 17.4.0后,项目忽然编译错误,后经反复排错发现:项目路径减短项目就不会出错。出错内容如下: 严重性    代码    说明    项目    文件    行    禁止显示状态 错误    MSB4018    “GenerateStaticWebAsssetsPropsFile”任务意外失败 。 System.

    2024年02月15日
    浏览(45)
  • Android studio之 build.gradle配置

    一. Project项目级别的build.gradle (1)、buildscript{}闭包里是gradle脚本执行所需依赖,分别是对应的maven库和插件。 闭包下包含: 1、repositories闭包 2、dependencies闭包 maven库 repositories 示列 插件dependencies示列 (2)、allprojects{}闭包里是项目本身需要的依赖,比如项目所需的maven库。

    2024年02月11日
    浏览(42)
  • 解决Android Studio在Build时报错乱码

    如图所示,在项目Build时报错乱码。 ①首先我们打开 Help - Edit Custom VM Options ; ②在打开文件的最后一行添加 -Dfile.encoding=UTF-8 ; ③ 在 File - Invalidate Caches ,点击 Invalidate and Restart 清除缓存并重启即可。 ④将项目重新Build ,效果如下图所示。

    2024年02月12日
    浏览(45)
  • Android Studio 显示build variants工具栏

    工具栏: 如下图所示 依次点击View--ToolWindows--Build Variants。 在此记个笔记

    2024年02月22日
    浏览(49)
  • Android Studio Build Output控制台输出乱码解决

    Android Studio版本升级到4.0之后,出现Build Output控制台输出乱码的现象。该情况在Android Studio版本3.6及以上就会出现。 解决方法: 点击Android Studio 菜单栏Help 下拉菜单找到 Edit Custom VM Options...选项。 打开studio64.exe.vmoptions 文件,输入 关闭studio,重新打开即可。 studio64.exe.vmoption

    2024年02月13日
    浏览(49)
  • Android studio 出现com.android.build.gradle.internal.res.ResourceCompilerRunnable问题解决

    classpath ‘com.android.tools.build:gradle:4.2.1’ 改为 classpath ‘com.android.tools.build:gradle:4.1.3’ 4.1.3是可以排查xml资源错误的 找到错误的xml文件修改就可以了,一般都是项目合并的时候使用了相同的名称,不同的值。4.2.1不能运行,所以报错了

    2024年02月11日
    浏览(67)
  • Android studio Gradle面板里不显示build Task的解决方法

    问题如图: 解决方法: 在AS中,  File--Settings--Experimental里去掉only include test tasks..这一行的勾选  最后刷新一下工程,点击sync Project按钮即可  

    2024年02月16日
    浏览(48)
  • Android Studio报错:Could not resolve com.android.tools.build:gradle:8.0.0

    Android Studio 新建项目会报以下错误: 完整版报错信息如下: 原因:此为Android Studio默认的JDK版本与项目配置的Gradle所需的JDK不一致导致冲突所致。要求选择同一版本的JDK,可以选择Android Studio自带的jdk17。 解决方案:点击File --Project Structure -SDK Location-JDK location gradle Settings,将

    2024年02月11日
    浏览(57)
  • android studio gradle build running慢 卡住不动 失败 原因与解决方式

    主要原因是 gradle 构建时无法从 网络 获取需要的包或库。 将国外库替换为阿里云镜像库。 例如 google 对应的库是 maven { url ‘https://maven.aliyun.com/repository/google’ }

    2024年02月11日
    浏览(79)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包