lessthanoptimal / BoofAndroidDemo

Demonstration of BoofCV for Android devices
125 stars 42 forks source link

Getting a crash in some mobile phones #20

Closed shyamkumarm closed 4 years ago

shyamkumarm commented 4 years ago

Boofcv Android: v0.35

Device list:

Samsung SM-J210F v6.0.1

PANASONIC ELUGA Ray Max v6.0.1

Samsung SM-G532M v6.0.1

LENOVO Lenovo PB2-650M v6.0

Samsung SM-J700M v6.0.1 ..etc

java.lang.RuntimeException: An error occurred while executing doInBackground() android.os.AsyncTask$3.done(AsyncTask.java:309) java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) java.util.concurrent.FutureTask.setException(FutureTask.java:223) java.util.concurrent.FutureTask.run(FutureTask.java:242) android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) java.lang.Thread.run(Thread.java:818) Caused by: java.lang.NoClassDefFoundError: boofcv.alg.filter.derivative.impl.f boofcv.alg.filter.derivative.impl.GradientPrewitt_Shared_MT.process(GradientPrewitt_Shared_MT.java) boofcv.alg.filter.derivative.GradientPrewitt.process(GradientPrewitt.java) boofcv.alg.filter.derivative.GradientPrewitt.process(GradientPrewitt.java) boofcv.abst.filter.derivative.ImageGradient_SB$Prewitt.process(ImageGradient_SB.java) boofcv.abst.filter.derivative.ImageGradient_SB$Prewitt.process(ImageGradient_SB.java) boofcv.abst.feature.detect.line.HoughGradient_to_DetectLine.detect(HoughGradient_to_DetectLine.java)

lessthanoptimal commented 4 years ago

I've seen that error in logs before but can't reproduce it. The line below makes no sense to me. I'll take a look at it again but if you have any ideas let me know! Thanks also for telling me which phones crash. Do those phones crash instantly when you enter that activity? Do they run for a bit then crash?

Caused by: java.lang.NoClassDefFoundError: boofcv.alg.filter.derivative.impl.f

shyamkumarm commented 4 years ago

Do those phones crash instantly when you enter that activity? Yes, I used to send a camera Image taken from an ImageReader to perform HoughLines.

lessthanoptimal commented 4 years ago

My best guess so far is that this is a multidex issue. However multidex should be enabled by default since SDK 21 and the minimum for this project is 22. I'm going to try to get one of those phones and resolve this, but most of them are not sold in the US as far as i can tell.

https://stackoverflow.com/questions/29489341/java-lang-noclassdeffounderror-exception-on-some-devices

shyamkumarm commented 4 years ago

I have done this, But still facing the same crash. please let me know If you find any solution. thanks

lessthanoptimal commented 4 years ago

got two cheap low end phones similar to what you listed above. The bad news is that it works perfectly on them. Any chance you could send a phone over?

lessthanoptimal commented 4 years ago

I forgot, this might be a concurrency issue. Try turning it off as shown there.

https://github.com/lessthanoptimal/BoofCV/issues/135

shyamkumarm commented 4 years ago

I guess we didn't face any crash if I set this BoofConcurrency.USE_CONCURRENT = false; Thanks @lessthanoptimal