inaturalist / react-native-inat-camera

React Native package that provides a camera with optional species recognition.
MIT License
10 stars 6 forks source link

OutOfMemoryError: ResolveTakenPictureAsyncTask.doInBackground #56

Closed albullington closed 3 years ago

albullington commented 3 years ago

Here's the stack trace. Happening on Huawei P8 running Android 6.0.

java.lang.RuntimeException: 
  at android.os.AsyncTask$3.done (AsyncTask.java:321)
  at java.util.concurrent.FutureTask.finishCompletion (FutureTask.java:354)
  at java.util.concurrent.FutureTask.setException (FutureTask.java:223)
  at java.util.concurrent.FutureTask.run (FutureTask.java:242)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
  at java.lang.Thread.run (Thread.java:833)
Caused by: java.lang.OutOfMemoryError: 
  at dalvik.system.VMRuntime.newNonMovableArray (Native Method)
  at android.graphics.BitmapFactory.nativeDecodeByteArray (Native Method)
  at android.graphics.BitmapFactory.decodeByteArray (BitmapFactory.java:580)
  at android.graphics.BitmapFactory.decodeByteArray (BitmapFactory.java:603)
  at org.inaturalist.inatcamera.nativecamera.ResolveTakenPictureAsyncTask.doInBackground (ResolveTakenPictureAsyncTask.java:152)
  at org.inaturalist.inatcamera.nativecamera.ResolveTakenPictureAsyncTask.doInBackground (ResolveTakenPictureAsyncTask.java:31)
  at android.os.AsyncTask$2.call (AsyncTask.java:307)
  at java.util.concurrent.FutureTask.run (FutureTask.java:237)
albullington commented 3 years ago

@budowski I'm seeing one that looks identical to this but with different line numbers in the latest build. Happening on a Hisense H910-F01, Android 7.0 device. Should I open a new issue or reopen this one?

java.lang.RuntimeException: 
  at android.os.AsyncTask$3.done (AsyncTask.java:318)
  at java.util.concurrent.FutureTask.finishCompletion (FutureTask.java:354)
  at java.util.concurrent.FutureTask.setException (FutureTask.java:223)
  at java.util.concurrent.FutureTask.run (FutureTask.java:242)
  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:761)
Caused by: java.lang.OutOfMemoryError: 
  at dalvik.system.VMRuntime.newNonMovableArray (Native Method)
  at android.graphics.BitmapFactory.nativeDecodeByteArray (Native Method)
  at android.graphics.BitmapFactory.decodeByteArray (BitmapFactory.java:533)
  at android.graphics.BitmapFactory.decodeByteArray (BitmapFactory.java:556)
  at org.inaturalist.inatcamera.nativecamera.ResolveTakenPictureAsyncTask.writeBitmap (ResolveTakenPictureAsyncTask.java:74)
  at org.inaturalist.inatcamera.nativecamera.ResolveTakenPictureAsyncTask.doInBackground (ResolveTakenPictureAsyncTask.java:263)
  at org.inaturalist.inatcamera.nativecamera.ResolveTakenPictureAsyncTask.doInBackground (ResolveTakenPictureAsyncTask.java:31)
  at android.os.AsyncTask$2.call (AsyncTask.java:304)
  at java.util.concurrent.FutureTask.run (FutureTask.java:237)