我的问题是关于Android Studio中的错误。每次当我尝试在Android Studio中运行Java项目时,我都会收到以下错误,我的程序不起作用:这是我的 gradle 配置:apply plugin: 'com.android.application'android { compileSdkVersion 26 defaultConfig { applicationId "com.example.christianmastracco.jsondemo" minSdkVersion 22 targetSdkVersion 26 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:26.1.0' 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'}我该如何解决?谢谢
2 回答

翻过高山走不出你
TA贡献1875条经验 获得超3个赞
将 你的 和 更改为 27,这样:compileSdkVersion
targetSdkVersion
implementation 'com.android.support:appcompat-v7:26.1.0'
到这个
implementation 'com.android.support:appcompat-v7:27.1.0'

临摹微笑
TA贡献1982条经验 获得超2个赞
将 和 都更新为版本和实现版本,如错误消息中所示。compileSdkVersion
targetSdkVersion
27
27.1.1
我不能评论Ernest Zamelczyk的答案(声誉50),但我认为正确的答案是,而不是他所说的。27.1.1
27.1.0
添加回答
举报
0/150
提交
取消