Glide java.lang.NoSuchMethodError: No virtual method

爱⌒轻易说出口 提交于 2020-07-06 14:00:04

问题


I'm facing an issue regarding Glide library.

I used couple of multiimagepicker API's from github but whenever i click for selecting image it crashes. every API crash because of this error

java.lang.NoSuchMethodError: No virtual method load(Ljava/lang/String;)Lcom/bumptech/glide/DrawableTypeRequest; in class Lcom/bumptech/glide/RequestManager; or its super classes (declaration of 'com.bumptech.glide.RequestManager' appears ...)

I'm badly stuck due to this error. i searched on glide forum but still no proper answer found. many looking for answer of this error

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'

}

回答1:


I got the same error using the currently latest version: 4.7.1

The error is likely to cause because of your dependencies, to me, downgrading the Glide version to 4.3.1 worked fine.

    implementation'com.github.bumptech.glide:glide:4.3.1'

By the way, use the term implementation, rather than compile as it will be removed this year.

This solution might not work for you, because your version is already 4.2.0

But anyway, Hope it works!




回答2:


after migrating android to androidx and upgrading the gradle to newer version I had some problems with glide..

after trying version one by one... this version was the only one that works for me..

recommending on glide 4.8.0

with the newer and with the elders i had some problems.. maybe this version will works for you too..

implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.android.support:support-annotations:28.0.0'
annotationProcessor 'com.android.support:support-annotations:28.0.0'

maybe you will find here some info that might help.. https://github.com/bumptech/glide/releases



来源:https://stackoverflow.com/questions/47069529/glide-java-lang-nosuchmethoderror-no-virtual-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!