android-studio - 无法解析':app @ debug/compileClasspath'的依赖项:无法解析com.android.support:appcompat-v7:28.0.0-rc01

标签 android-studio

我在新的Android Studio版本中遇到错误,基本的hello世界也未在gradle中构建。云你请帮忙一样。

这是我在新的android studio版本中遇到的错误:



我的gradle文件如下

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "payments.com.java.payments"
        minSdkVersion 17
        targetSdkVersion 28
        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:28.0.0-rc01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    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'
}


这是我得到的日志


无法解析':app @ debug / compileClasspath'的依赖关系:无法解析com.android.support:appcompat-v7:28.0.0-rc01。
打开文件
显示详细资料

无法解析':app @ debug / compileClasspath'的依赖关系:无法解析com.android.support.constraint:constraint-layout:1.1.2。
打开文件
显示详细资料

无法解析':app @ debugAndroidTest / compileClasspath'的依赖关系:无法解析com.android.support.test:runner:1.0.2。
打开文件
显示详细资料

无法解析':app @ debugAndroidTest / compileClasspath'的依赖项:无法解析com.android.support.test.espresso:espresso-core:3.0.2。
打开文件
显示详细资料

无法解决依赖关系
':app @ debugAndroidTest / compileClasspath':无法解析com.android.support:appcompat-v7:28.0.0-rc01。
打开文件
显示详细资料

无法解析':app @ debugAndroidTest / compileClasspath'的依赖关系:无法解析com.android.support.constraint:constraint-layout:1.1.2。
打开文件
显示详细资料

无法解析':app @ debugUnitTest / compileClasspath'的依赖项:无法解析com.android.support:appcompat-v7:28.0.0-rc01。
打开文件
显示详细资料

无法解析':app @ debugUnitTest / compileClasspath'的依赖关系:无法解析com.android.support.constraint:constraint-layout:1.1.2。
打开文件
显示详细资料

无法解析':app @ release / compileClasspath'的依赖关系:无法解析com.android.support:appcompat-v7:28.0.0-rc01。
打开文件
显示详细资料

无法解析':app @ release / compileClasspath'的依赖关系:无法解析com.android.support.constraint:constraint-layout:1.1.2。
打开文件
显示详细资料

无法解析':app @ releaseUnitTest / compileClasspath'的依赖关系:无法解析com.android.support:appcompat-v7:28.0.0-rc01。
打开文件
显示详细资料

无法解析':app @ releaseUnitTest / compileClasspath'的依赖关系:无法解析com.android.support.constraint:constraint-layout:1.1.2。
打开文件
显示详细资料

最佳答案

检查您的互联网连接。对我来说,这只是互联网连接问题。如果您在代理服务器下。转到文件>设置>外观和行为>系统设置> HTTP代理,然后在此处输入您的代理详细信息。使用检查连接选项来验证您的连接。这是对我的gradle文件的引用。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
       applicationId "com.oops.pk.birthday_card"
       minSdkVersion 23
       targetSdkVersion 28
       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:28.0.0-rc02'
     implementation 'com.android.support:support-v4:28.0.0'
     implementation 'com.android.support:recyclerview-v7:28.0.0'
     implementation 'com.android.support:design:28.0.0'
     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'
 }

关于android-studio - 无法解析':app @ debug/compileClasspath'的依赖项:无法解析com.android.support:appcompat-v7:28.0.0-rc01,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51733748/

相关文章:

android - 如何在 NDK 原生代码中获取断点并在 Android Studio 中调试原生代码?

android - Gradle 同步失败 : Failed to update Android plugin to version '2.0.0'

java - Android src/main/java 文件夹

android - 将android studio 1.2项目导入android studio 3.0

java - 自 API 29 以来,小部件点击振动不起作用

java - 在 TextView Android studio 上显示数据库中的信息

java - OnBindViewHolder 下的 onClickListener 函数给出了奇怪的结果

Android:buildconfig.class 中的 build.gradle zip 异常中的重复条目

android - 如何为最终版本 apk 设置我的 gradle

android-studio - 如何在logcat Android Studio中排除Log标签?