Android | 开发过程遇到的报错以及解决方法

注: 此博客为记录个人开发过程中遇到的报错问题以及解决方案。

由于不同版本环境等因素影响,解决方案对其他人可能无效。

本博客仅提供一种解决思路,具体问题请具体分析。

  • 报错:Gradle报错:

    1: Task failed with an exception.


    • What went wrong:

    A problem was found with the configuration of task ':app:checkDebugManifest' (type 'CheckManifest').

    复制代码
    - 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.0.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.

    ==============================================================================

  • 解决:将gradle-wrapper.properties中的gradle版本降级

    distributionUrl=https://services.gradle.org/distributions/gradle-7.0.2-bin.zip

修改为

复制代码
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
Java version First Gradle version to support it
8 2.0
9 4.3
10 4.7
11 5.0
12 5.4
13 6.0
14 6.3
15 6.7
16 7.0
17 7.3
18 7.5
19 7.6
20 8.1
[Java版本与Gradle版本对应]

注:在Android Studio修改Java版本方法:

  • 报错:
  • 参考:
  • 解决:

(未完待续...)

相关推荐
随遇丿而安4 小时前
第11周:Activity 跳转与传值 + 跳转优化
android
私人珍藏库5 小时前
[Android] BBLL 开源第三方B哩电视TV端
android·app·生活·工具·多功能
杉氧7 小时前
跨平台资源管理:一套代码如何搞定 Android、iOS 和 Web 的图片与多语言?
android·架构·android jetpack
安卓修改大师8 小时前
安卓修改大师实战:从反编译到定制的完整APK修改指南
android
柚鸥ASO优化10 小时前
安卓APP推广的“降本增效”密码:守好商店内,打好商店外
android·aso优化
我是一颗柠檬10 小时前
【Java项目技术亮点】EXPLAIN深度分析与慢查询治理
android·java·开发语言
Android-Flutter10 小时前
android compose shadow 阴影 使用
android·kotlin·compose
帅次11 小时前
Android 高级工程师面试:Java 多线程与并发 近1年高频追问 22 题
android·java·面试
2501_9437823511 小时前
【共创季稿事节】摩斯电码转换器:编码表与双向转换的实现
android·华为·鸿蒙·鸿蒙系统
STCNXPARM11 小时前
Android selinux详解
android·selinux