我在我的新Android Studio版本中遇到以下错误,基本的Hello world也无法在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。 打开文件 显示详细信息
androidx.appcompat:appcompat
库代替com.android.support:appcompat-v7
,因为支持库在28.0.0之后将不再获得更新。 - tyczjimplementation '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'
- user2454202