bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.49k stars 6.11k forks source link

NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference #4618

Open luna-vulpo opened 2 years ago

luna-vulpo commented 2 years ago

Glide Version:

    //Glide
    def glideVersion = "4.12.0"
    implementation "com.github.bumptech.glide:glide:$glideVersion"
    implementation "com.github.bumptech.glide:okhttp3-integration:$glideVersion"
    kapt "com.github.bumptech.glide:compiler:$glideVersion"

Integration libraries: implementation 'com.squareup.okhttp3:okhttp:4.9.0'

Device/Android Version: randomly different devices

Issue details / Repro steps / Use case background: not sure that it has any visibly effects

Stack trace / LogCat:

Glide: Load failed for  with size [472x262]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There was 1 cause:
    java.lang.NullPointerException(Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference)
     call GlideException#logRootCauses(String) for more detail
      Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{StringUri->Object->Drawable}, LOCAL
    There was 1 cause:
    java.lang.NullPointerException(Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference)
     call GlideException#logRootCauses(String) for more detail
        Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{StringUri->Drawable->Drawable}
    There was 1 cause:
    java.lang.NullPointerException(Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference)
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
        Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{StringUri->Bitmap->Drawable}
2020-11-03 12:25:03.496 4044-4044//Glide: Root cause (1 of 1)

    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
        at com.bumptech.glide.load.resource.drawable.ResourceDrawableDecoder.handles(ResourceDrawableDecoder.java:54)
        at com.bumptech.glide.load.resource.drawable.ResourceDrawableDecoder.handles(ResourceDrawableDecoder.java:25)
        at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:90)
        at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:70)
        at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:59)
        at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:76)
        at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:57)
        at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:524)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:488)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:474)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:426)
        at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:390)
        at com.bumptech.glide.load.engine.SourceGenerator.onDataReadyInternal(SourceGenerator.java:148)
        at com.bumptech.glide.load.engine.SourceGenerator$1.onDataReady(SourceGenerator.java:76)
        at com.bumptech.glide.load.model.UnitModelLoader$UnitFetcher.loadData(UnitModelLoader.java:55)
        at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310)
        at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:279)
        at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:234)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
        at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
afrooqueen commented 2 years ago

Omg this is happening to me right now what should I do?

44667788 commented 2 years ago

Are there any cases for this problem?

pablo19892018 commented 1 year ago

This is an error when having many bluetooth devices linked, disconnect the other devices and only leave the one you want connected, after that it will work without problems.

Fabi755 commented 1 year ago

In my case the cause was a missing scheme.

Checkout if your URI have a scheme. Don't use URLs without https:// or pathes without file://!