Android crash
Hello,
I have a strange error when detecting faces...when I want to detect faces on one image where faces have already been detected before , the app crashes almost all the time (goes in background and restarts)
When I export a debug build it is working (but can crash sometimes) and always crashes with release APK.
In the logs I have : I/FaceDetection(21259): FaceDetection::isAvailable I/FaceDetection(21259): FaceDetection::isOperational I/FaceDetection(21259): FaceDetection::setLogEnabled true I/FaceDetection(21259): FaceDetection::detect W/FaceDetector(21259): FaceDetector was not released with FaceDetector.release() W/FaceDetector(21259): FaceDetector was not released with FaceDetector.release() W/FaceDetector(21259): FaceDetector was not released with FaceDetector.release() W/FaceDetector(21259): FaceDetector was not released with FaceDetector.release() W/FaceDetector(21259): FaceDetector was not released with FaceDetector.release() I/FaceDetection(25410): Running FaceDetection in new thread
But I am disposing after each detection like this FaceDetection.dispose();
And the related code to my app death :
I/WindowState( 1004): WIN DEATH: Window{88c1b2 u0 com.appID/com.appID.AppEntry} W/WindowManager( 1004): Force-removing child win Window{30e89b3d u0 SurfaceView} E/WindowState( 1004): getStack: Window{b484b10 u0 com.appID/com.appID.AppEntry} couldn't find taskId=2875 Callers=com.android.server.wm.WindowState.getDisplayContent:1224 com.android.server.wm.WindowState.isDefaultDisplay:1845 com.android.server.wm.WindowState.getMultiWindowStyleLw:2377 com.android.server.wm.WindowManagerService.setFocusedApp:5680 V/ApplicationPolicy( 1004): isApplicationStateBlocked userId 0 pkgname com.appID
Do you have any idea ?
It's the same if I clone a bitmapdata. In fact it seems to crash if the results are the same between two images...
Hi @Stortof,
That's strange. I can't reproduce anything like this.
Are you calling the second detection from within the callback of the first detection?
By the way, you shouldn't call FaceDetection.dispose(); after each detection. This disposes the extension context, so you should only call it when you don't want to make any other detections.
Thanks for your reponse,
No, in fact I have an Array of Bitmapdatas, and I detect faces of Array[0], then Array[1]...etc. each time I touch the screen (so it's not a callback). If I have 2 instances of the same bitmapdata in my Array, the app crashes when I am trying to detect faces on the second one... If all the bitmapdata are differents, the app crashes when I am trying to detect faces on the Array[0] again.
I am going to make more tests if I can and also remove the FaceDetection.dispose();