【发布时间】:2017-11-02 07:10:52
【问题描述】:
我遇到了关于 Glide 库的问题。
我使用了几个来自 github 的 multiimagepicker API
但每当我click 选择图像时
它崩溃了。
每个 API 都会因为这个错误而崩溃
java.lang.NoSuchMethodError: 没有虚拟方法 加载(Ljava/lang/String;)Lcom/bumptech/glide/DrawableTypeRequest;在 Lcom/bumptech/glide/RequestManager 类;或其超类 (“com.bumptech.glide.RequestManager”的声明出现......)
由于这个错误,我被严重卡住了。 我在滑翔论坛上搜索,但仍然没有找到正确的答案。许多人正在寻找这个错误的答案
Build.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.mikepenz:aboutlibraries:5.9.7@aar') {
transitive = true
exclude group: 'com.android.support'
}
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:cardview-v7:26.0.+'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.lolucosmin:PermissionsWrapper:version_1.2'
compile 'com.github.javiersantos:BottomDialogs:1.2.1'
compile 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
compile 'com.appyvet:materialrangebar:1.4'
compile 'com.github.vivchar:ViewPagerIndicator:v1.0.1'
compile 'com.github.bumptech.glide:glide:4.2.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'
compile 'com.github.chathuralakmal:AndroidImagePopup:1.2'
compile 'com.ss.bannerslider:bannerslider:1.8.0'
compile 'org.aviran.cookiebar2:cookiebar2:1.0.5'
compile 'com.github.hamsaadev:RTLMaterialSpinner:V1.0.1'
compile 'com.github.darsh2:MultipleImageSelect:v0.0.4'
}
【问题讨论】:
-
在 build.gradle 中添加 glide 依赖
-
已经添加了滑行
-
显示你的
build.gradle -
使用 glide
com.github.bumptech.glide:glide:3.8.0因为最新的 glide 4.x 有一些重大变化 -
@MuhammadSaad 使用最新的
com.github.bumptech.glide:glide:4.3.0
标签: android android-glide