저는 glide 및 firebase를 사용하여 업로드 및 다운로드 이미지를 관리하여 사용자 프로필 사진을 표시하고 있습니다. 저는 github repo에서 firebaseUI 및 glide에 대해 이야기하는 곳을 따릅니다. 처음에는 프로젝트가 제대로 작동했을 때 앱 gradle이 다음과 같았습니다.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:design:25.2.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
testCompile 'junit:junit:4.12'
firebaseUI 버전을 포함하려면 firebase와 관련된 모든 컴파일을 10.2.0으로 업그레이드해야한다고 말하는 문서를 읽은 후 다음을 수행했습니다.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.google.firebase:firebase-storage:10.2.0'
compile 'com.firebaseui:firebase-ui:1.2.0'
testCompile 'junit:junit:4.12'
}
하지만 첫 번째 컴파일에서 계속 오류가 발생합니다. compile 'com.android.support:appcompat-v7:25.2.0'
오류는 다음과 같습니다.
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.2.0, 25.1.1. Examples include com.android.support:animated-vector-drawable:25.2.0 and com.android.support:cardview-v7:25.1.
내 프로젝트 gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.fabric.io/public'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
이 오류에 대해 혼란스러워하는 데 도움이 필요합니다.
첫째, 이것은 Glide 라이브러리 와 관련이 없습니다 .
gradle은 "이 프로젝트에는 다른 버전의 Android 지원 패키지가 있습니다."라고 표시되므로 동일한 버전의 모든 com.android.support 패키지를 사용해야합니다. 예를 들어 프로젝트에는 '25 .2.0 '과 '25 .1.1'이 있습니다.
어떻게 이것을 달성 할 수 있습니까? 이 블록을 앱 수준 build.gradle에 넣습니다.
android {
...
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.2.0'
}
}
}
}
dependencies {
...
}
"하지만 25.2.0 인 동일한 레벨로 모든 안드로이드 지원 패키지를 컴파일합니다"라고 말할 수 있습니다. 일부 라이브러리에는 Android 지원 패키지가 포함되어 있으며 25.1.1은 종속성에서 제공됩니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다