mitchtabian / TabianCustomCamera

Custom camera for android using camera2 api (DEPRECATED)
153 stars 64 forks source link

Glide crashes with glide.Registry$NoModelLoaderAvailableException upon taking a picture #8

Closed EyrisCrafts closed 5 years ago

EyrisCrafts commented 5 years ago

NOTE: I have changed nothing to the code. It is as is from the github. Here is The PhoneTest Result.

----------- Device Information -----------

 OS Version: 3.18.31-perf-ga2421ba(V9.6.5.0.NAMMIFD)
 OS API Level: 25
 Device: santoni
 Model (and Product): Redmi 4X (santoni)

----------- Display Properties -----------

 Display Width: 720
 Display Height: 1280
 Aspect Ratio: 1.7777778

Here is the Error itself..

2018-12-04 15:07:56.490 22394-22600/codingwithmitch.com.tabiancustomcamera E/GlideExecutor: Request threw uncaught throwable com.bumptech.glide.Registry$NoModelLoaderAvailableException: Failed to find any ModelLoaders for model: android.media.ImageReader$SurfaceImage@742293a at com.bumptech.glide.Registry.getModelLoaders(Registry.java:584) at com.bumptech.glide.load.engine.DecodeHelper.getLoadData(DecodeHelper.java:205) at com.bumptech.glide.load.engine.DecodeHelper.getCacheKeys(DecodeHelper.java:223) at com.bumptech.glide.load.engine.ResourceCacheGenerator.startNext(ResourceCacheGenerator.java:44) at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:302) at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:269) at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:233) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:760) at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)

It crashes after I take a picture (I have given it all the permissions). Then I tried to replace glide with UniversalImageLoader (https://github.com/nostra13/Android-Universal-Image-Loader) However, it does not seem to accept an Image Object as input (I am newbie). Thanks

mitchtabian commented 5 years ago

Is this where the crash is occuring?

image

EyrisCrafts commented 5 years ago

Yes

mitchtabian commented 5 years ago

Please send me a link containing a gist of your Camera2Fragment.java class.

You can create a gist here: https://gist.github.com

EyrisCrafts commented 5 years ago

I'm not sure if this is how to create a gist. Hopefully this is what you are asking for.

https://gist.github.com/K-Rafiki/4cdead426b2ff179c734ec96000c206e

mitchtabian commented 5 years ago

Yep just remove the .js and it's good. I'll take a look tomorrow it's 11:30pm now.

mitchtabian commented 5 years ago

Looks like the Camera2 API does not work on your phone. From what I've read online it looks like you need to root the phone and make some alterations. https://xiaomifirmware.com/guides-and-tips/google-hdr-camera-slo-mo-redmi-4x/