【发布时间】:2019-03-25 00:45:22
【问题描述】:
无法解决 Glide 库 android 中的 centercrop 占位符错误等。 还尝试使用 glide 进入一个新项目,但问题也存在。 请帮助我,这一切都正确或需要添加更多内容才能使用 Glide 库。
项目构建.gradel
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
maven {
url "http://repo1.maven.org/maven2"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app-build.gradel
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.techweblearn.musicplayer"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
renderscriptTargetApi 20
renderscriptSupportModeEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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.github.bumptech.glide:glide:4.0.0-RC0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
}
'
【问题讨论】:
-
堆栈跟踪或编译错误在哪里?
-
我遇到了同样的问题。到目前为止,我发现的唯一解决方案是将 Glide 版本降级为 com.github.bumptech.glide:glide:3.8.0
标签: java android android-glide