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版本方法:

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

(未完待续...)

相关推荐
pedestrian_h4 小时前
操作系统-线程
android·java·开发语言
gfdgd xi5 小时前
GXDE 内核管理器 1.0.1——修复bug、支持loong64
android·linux·运维·python·ubuntu·bug
美狐美颜sdk5 小时前
跨平台直播美颜sdk集成攻略:Android、iOS与Web的统一方案
android·前端·ios
❀͜͡傀儡师6 小时前
二维码/条码识别、身份证识别、银行卡识别、车牌识别、图片文字识别、黄图识别、驾驶证(驾照)识别
android·scanner
生莫甲鲁浪戴7 小时前
Android Studio新手开发第三十五天
android·ide·android studio
qq_717410018 小时前
FAQ20472:相机录像镜像功能实现
android
非专业程序员Ping9 小时前
HarfBuzz 实战:五大核心API 实例详解【附iOS/Swift实战示例】
android·ios·swift
流星魂小七10 小时前
颜色选择器
android·着色器·环形颜色选择器·圆形颜色选择器·colorpicker·colorwheelview
cdming10 小时前
LIUNX 与手机安卓的文件互传 的常用方法
android·智能手机
雨白12 小时前
Flow 的异常处理与执行控制
android·kotlin