我在新的Android工作室版本中得到以下错误基本的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'
}
Run Code Online (Sandbox Code Playgroud)
这是我得到的日志
无法解析':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.打开文件显示细节
小智 9
检查您的互联网连接。对我来说,这只是互联网连接问题。如果您在代理服务器下。转到文件>设置>外观和行为>系统设置> 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'
}
Run Code Online (Sandbox Code Playgroud)
小智 0
如果您有任何其他正在运行(不是错误)的 Android Studio 项目,
build.gradle您可以检查您的设置Project - app并查找此行:
implementation 'com.android.support:appcompat-v7:***'
Run Code Online (Sandbox Code Playgroud)
是你的工作项目中的工作SDK版本,然后替换你的
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
Run Code Online (Sandbox Code Playgroud)
与工作 SDK 版本 (***)
如果您没有任何工作(没有错误)项目,您可以尝试我的:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
Run Code Online (Sandbox Code Playgroud)
希望这可以解决您的问题,因为它刚刚解决了我的问题。
| 归档时间: |
|
| 查看次数: |
28054 次 |
| 最近记录: |