I am using Glide
in my Android app to crop and cache a bitmap
that I then post to my API. I handle the threading with Anko
. This is my code:
val bitmap=preview_image_view.drawable as BitmapDrawable //I previously used `preview_image_view.setDrawable` to set this image. It shows properly in the debugger!
doAsync{ //an Anko specific thing
val file= Glide.with(applicationContext).asFile().load(bitmap).apply(RequestOptions().apply{
diskCacheStrategy(DiskCacheStrategy.RESOURCE)
centerCrop()
override()
}).submit().get() //Mysterious failure on submit()
uiThread{ //another Anko specific thing
Fuel.upload(.....
I get the following error whenever I hit the submit()
function
W/Glide: Load failed for android.graphics.drawable.BitmapDrawable@fb798b8 with size [400x400]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
Glide
gives me no causes, stack trace, etc. to help me find why this error is occuring. Any ideas as to what is causing it to fail?