[我试图运行android studio,但出现等级同步错误。依赖,调试有五个错误。有什么解决方法

问题描述 投票:0回答:1

我正在使用android 3.1.4和等级版本,我已经尝试过4.4 4.5 4.10和最新的5.6.2,但是它们似乎都没有帮助。最新版本显示了一些其他错误。解决方案是什么?

android-studio
1个回答
0
投票

对于最小api 21和目标28,我的build.gradle(Module:app)文件具有以下设置。

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.example.yourprojectname"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 
'proguard-rules.pro'
    }
 }
 }

 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
     implementation 'com.android.support:appcompat-v7:28.+'
     implementation 'com.android.support:support-v4:28.+'
     implementation 'com.android.support:design:28.+'
     implementation 'com.android.support.constraint:constraint-layout:1.0.2'
     testImplementation 'junit:junit:4.12'
     androidTestImplementation 'com.android.support.test:runner:1.0.1'
     androidTestImplementation 'com.android.support.test.espresso:espresso- 
     core:3.0.1'

}

如果您具有不同的最低api级别,请将属性minSdkVersion更改为您的api并再次在线同步。希望这会有所帮助。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.