janrick 2022-03-05 11:00 采纳率: 33.3%
浏览 626
已结题

Android编译出错:ComponentSelectionReason.getDescription()Ljava/lang/String;

Android编译报错

ERROR: Unable to find method 'org.gradle.api.artifacts.result.ComponentSelectionReason.getDescription()Ljava/lang/String;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.


gradle-wrapper.properties文件的配置

#Tue May 18 14:14:57 CST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip


build.gradle文件的配置

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url 'https://repo1.maven.org/maven2/' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url 'https://repo1.maven.org/maven2/' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 3月13日
    • 创建了问题 3月5日

    悬赏问题

    • ¥15 esp32驱动GC9A01循环播放视频
    • ¥15 惠普360g9的最新bios
    • ¥15 配置hadoop时start-all.sh老是启动失败
    • ¥30 这个功能用什么软件发合适?
    • ¥60 微信小程序,取消订单,偶尔订单没有改变状态
    • ¥15 用pytorch实现PPO算法
    • ¥15 关于调制信号的星座图?
    • ¥30 前端传参时,后端接收不到参数
    • ¥15 这是有什么问题吗,我检查许可证了但是显示有呢
    • ¥15 机器学习预测遇到的目标函数问题