【发布时间】:2017-08-03 11:47:05
【问题描述】:
我正在使用最新的Glide Android 库。在编译时没有错误,但是当应用程序安装在设备上时,它会在运行时显示此错误:
java.lang.NoClassDefFoundError:解析失败: Lcom/bumptech/glide/滑翔;
我在Glide官方Github页面中包含了以下模块:
compile 'com.github.bumptech.glide:glide:4.0.0' compile 'com.android.support:support-v4:25.3.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
错误仍然存在。
构建.gradle:
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
}
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.esmartify"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
minifyEnabled false
}
}
}
dependencies {
compile fileTree(include: '*.jar', dir: 'libs')
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.google.android.gms:play-services:11.0.2'
compile 'com.firebase:geofire-android:2.1.1'
compile 'com.firebaseui:firebase-ui-auth:2.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.22.1'
compile 'com.google.firebase:firebase-auth:11.0.1'
compile 'com.google.firebase:firebase-crash:11.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.android.gms:play-services-maps:11.0.2'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
debugCompile 'com.facebook.stetho:stetho:1.5.0'
debugCompile 'com.uphyca:stetho_realm:2.1.0'
}
apply plugin: 'com.google.gms.google-services'
编辑:我认为问题出在其他地方,因为使用 Picasso 而不是 Glide 会引发与 Picasso java.lang.NoClassDefFoundError 相同的错误
【问题讨论】:
-
看起来是版本依赖错误
-
compile 'com.android.support:appcompat-v7:25.3.1'尝试使用 v7 -
我已经尝试了所有可能的版本组合。还是没有成功
-
@sagarsuri 是的,我也有这个。
-
它是否在 logcat 中的
Activity中显示任何行?
标签: android android-glide