Cordova SDK versions 5.5 up to 5.7 have issues when the device orientation is changed from landscape to portrait and back multiple times (scan freeze or app crash). In versions 5.5 and 5.6 we notice a scan freeze wherein a document is no longer recognized. In version 5.7 we see a NullpointerException in the logging causing the application to shut down.
Steps to reproduce:
- Make sure to enable the android setting for "auto-rotate screen" on your phone
- Follow the: "How to build the demo application" readme
- Start the app
- Choose MRZ
- Start 'scan doc' (do not point the camera to a document)
- Start rotating the device multiple times (number of rotations to trigger the app crash depends on the phone model. We tested on a Samsung S20)
- Witness the app crash
See logging with NullpointerException below:
08-23 16:28:17.890 25143 25143 E AndroidRuntime: Process: com.regula.documentreader, PID: 25143
08-23 16:28:17.890 25143 25143 E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'int com.regula.documentreader.api.results.DocumentReaderResults.rfidResult' on a null object reference
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.DocumentReader.notifyClient(DocumentReader.java:1145)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.DocumentReader.notifyClient(DocumentReader.java:1131)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.CaptureActivity3.handleCompletion(CaptureActivity3.java:1188)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.CaptureActivity3.onCompleted(CaptureActivity3.java:1005)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.RecognitionTask.onPostExecuteNotification(RecognitionTask.java:116)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.DocReaderAsyncTask.onPostExecute(DocReaderAsyncTask.java:28)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.RecognitionTask.onPostExecute(RecognitionTask.java:125)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.RecognitionTask.onPostExecute(RecognitionTask.java:14)
08-23 16:28:17.903 3536 3547 W ActivityManager: crash : com.regula.documentreader,0
08-23 16:28:17.906 3536 3547 W ActivityManager: Force finishing activity com.regula.documentreader/.api.CaptureActivity3
Cordova SDK versions 5.5 up to 5.7 have issues when the device orientation is changed from landscape to portrait and back multiple times (scan freeze or app crash). In versions 5.5 and 5.6 we notice a scan freeze wherein a document is no longer recognized. In version 5.7 we see a NullpointerException in the logging causing the application to shut down.
Steps to reproduce:
See logging with NullpointerException below:
08-23 16:28:17.890 25143 25143 E AndroidRuntime: Process: com.regula.documentreader, PID: 25143
08-23 16:28:17.890 25143 25143 E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'int com.regula.documentreader.api.results.DocumentReaderResults.rfidResult' on a null object reference
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.DocumentReader.notifyClient(DocumentReader.java:1145)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.DocumentReader.notifyClient(DocumentReader.java:1131)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.CaptureActivity3.handleCompletion(CaptureActivity3.java:1188)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.CaptureActivity3.onCompleted(CaptureActivity3.java:1005)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.RecognitionTask.onPostExecuteNotification(RecognitionTask.java:116)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.DocReaderAsyncTask.onPostExecute(DocReaderAsyncTask.java:28)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.RecognitionTask.onPostExecute(RecognitionTask.java:125)
08-23 16:28:17.890 25143 25143 E AndroidRuntime: at com.regula.documentreader.api.RecognitionTask.onPostExecute(RecognitionTask.java:14)
08-23 16:28:17.903 3536 3547 W ActivityManager: crash : com.regula.documentreader,0
08-23 16:28:17.906 3536 3547 W ActivityManager: Force finishing activity com.regula.documentreader/.api.CaptureActivity3