【发布时间】:2018-07-17 17:11:43
【问题描述】:
我尝试使用特定活动运行我的应用程序,但我正在发生连续崩溃。
我已查明与 appcompat 版本有关的错误。但是,我不确定如何修复此错误,即在同一版本上获取我的所有依赖项。
我想知道是否有快速解决方法可以做到这一点?如果没有,有哪些步骤可以确保它们都在正确/相同的版本上?
build.gradle(模块:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.benchalmers.myapplication"
minSdkVersion 15
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:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
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'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.volley:volley:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
}
这是给我的错误:
所有 com.android.support 库必须使用完全相同的版本 规范(混合版本可能导致运行时崩溃)。成立 版本 27.0.2、26.1.0。例子包括 com.android.support:support-compat:27.0.2 和 com.android.support:animated-vector-drawable:26.1.0 少... (⌘F1) 有一些库或工具和库的组合,它们 不兼容,或者可能导致错误。一种这样的不兼容性是 使用不支持的 Android 支持库版本进行编译 最新版本(或者特别是低于您的 targetSdkVersion。)
任何帮助将不胜感激。谢谢。
【问题讨论】:
-
从终端运行
gradlew dependencies。哪些库取决于任何支持库的版本 27.0.2?
标签: android android-support-library