【问题标题】:I could not create a new project " Unable to resolve dependency for ':app@debug/compileClasspath' "我无法创建新项目“无法解析':app@debug/compileClasspath'的依赖关系”
【发布时间】:2020-03-14 16:29:39
【问题描述】:

我使用的是 Windows 10 和 Android Studio 版本 3.2.1

我面临两个问题:

1- 当我尝试在 SDK 管理器中更新或安装软件包时,我收到以下消息:

安装未成功完成。查看 IDE 日志 详情

2- 当我创建一个新项目时出现此错误:

无法解析 ':app@debug/compileClasspath' 的依赖关系:可以 找不到任何匹配的版本 com.android.support:appcompat-v7:29.+.

无法解决依赖关系 ':app@debugAndroidTest/compileClasspath': 找不到任何版本 匹配 com.android.support:appcompat-v7:29.+.


build.gradle(模块):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.one-click.myapplication"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:29.+'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

我尝试了很多解决方案,但没有任何好处,希望你能帮助我

【问题讨论】:

    标签: javascript android android-studio gradle


    【解决方案1】:

    将实现 'com.android.support:appcompat-v7:29.+' 更改为以下,并将 compileSdkVersion 29 更改为 compileSdkVersion 28,将 targetSdkVersion 29 更改为 targetSdkVersion 28

    实现 'com.android.support:appcompat-v7:28.0.0' 实现 'com.android.support:support-v4:28.0.0'

    【讨论】:

    • 它将正常工作,并确保您已下载 API 28。只需打开 SDK 管理器即可看到它,如果未下载则下载它
    猜你喜欢
    • 2018-06-26
    • 2018-12-15
    • 2019-04-07
    • 1970-01-01
    • 1970-01-01
    • 2018-08-26
    • 1970-01-01
    • 1970-01-01
    • 2022-08-15
    相关资源
    最近更新 更多