由于我已将 Nexus 5x 升级到 Android O DP3,我无法测试我的应用程序。我收到错误,因为没有配置我的 Gradle 文件以使用新的 API 级别 (26)。
所以我改变了这个和依赖关系,但我的所有支持库都出现错误,比如
Failed to resolve: com.android.support:design:26.0.0-beta2
点击
Install repository and sync project
弹出一个进度对话框,用于下载正确的依赖项,但不会删除错误。清理项目、安装存储库然后重建项目也不起作用。
appcompat-v7
在 appcompat-v7:26.0.0-beta2 上,我得到(甚至在 Gradle 同步之前)很快就出现错误:
When using a compileSdkVersion older than android-O revision 2,
the support library version must be 26.0.0-alpha1 or lower (was 26.0.0-beta2)
有人可以帮我为 Android API 26 正确配置 gradle 文件吗?任何帮助,将不胜感激。
PS:我目前正在使用 Gradle 3.0.0-alpha3 但在 Gradle 2.3.2 上遇到相同的错误
我的 Gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
defaultConfig {
applicationId "********"
minSdkVersion 21
targetSdkVersion 26
versionCode 3
versionName "2.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.0.0-beta2'
compile 'com.android.support:design:26.0.0-beta2'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:cardview-v7:26.0.0-beta2'
compile 'com.android.support:recyclerview-v7:26.0.0-beta2'
compile 'com.redbooth:WelcomeCoordinator:1.0.1'
compile 'com.github.kittinunf.fuel:fuel-android:1.4.0'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.ramotion.foldingcell:folding-cell:1.1.0'
}