我的問題是關于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
提交
取消