2 years ago

#40890

test-img

amanfreda

Xiaomi Redmi 7A camera crash

I am looking for help, with a camera crashing problem on an Xiaomi Redmi 7A mobile device.

Device: Xiaomi Redmi 7A, 2GB RAM 16GB ROM, MIUI 12.5.3
Platform: Android 10
Nodejs: 10.24.1
Application Framework: Cordova 9.0.0
Plugins: cordova-plugin-camera 5.0.3, cordova-plugin-advanced-imagepicker 1.5.4, cordova-plugin-background-mode

Description:

In my cordova application (https://github.com/amanfreda/cordova-camera-debug), I want to utilize the camera. The cordova plugins, that I have tried to use are cordova-plugin-advanced-imagepicker (https://github.com/EinfachHans/cordova-plugin-advanced-imagepicker) and the basic cordova camera plugin cordova-plugin-camera (https://github.com/apache/cordova-plugin-camera). They work fine on most devices, except on Xiaomi Redmi 7A. On this specific device, the application crashes at the moment the camera is opened and the picture is taken (as seen in the logs). Then, when the plugin wants to return the image data to the application, the application restarts and the image data is lost. After some googling, the issue seems to be, that Xiaomi's MIUI OS is pretty agressive with killing background processes.

Solutions I Tried:

Both obvously didn't work, with either camera plugin. This is as far as I got, before I was out of ideas. The github link to the application includes the sample application (nothing fancy, just a couple of buttons that open the camera with the plugins I listed above), and also some logcat logs in the log folder. The logcat logs contain a verbose output of all the logs, application logs and chromium logs. The chrome://inspect console is not much use in this case, because no errors were logged.

So, if anyone came across similar issues I would be grateful for any sort of info that could be provided.

javascript

android

cordova

xiaomi

0 Answers

Your Answer

Accepted video resources