Crashes app on Android when used with Cordova Screen Orientation Plugin
Phonegap version: cli-7.0.1 android-minSdkVersion: 14 android-targetSdkVersion: 26 cordova-plugin-screen-orientation version: 2.0.1 cordova-plugin-camera-preview: 0.9.0
Device: Google Pixel Android version: 8.0.0
Crashes only after calling screen.orientation.lock() and subsequently pausing or minimizing the app. Retrieving the screen orientation doesn't seem to cause issues.

@WeaponX86 Hi, I have an app where cordova-plugin-camera-preview is working together with cordova-plugin-screen-orientation.
First of all the current version of cordova-plugin-screen-orientation seems to be 2.0.2. Please update the plugin and try again. Maybe it was a temporary problem.
If not, here is a sample source code that works for me
document.addEventListener('deviceready', function() {
screen.orientation.lock('landscape');
CameraPreview.startCamera({}, function() {
alert('camera started succesfully');
}, function(_error) {
alert('camera could not be started. ' + _error);
});
}, false);
This short snippet is not tested under Android 8 but the aforementioned app is working with a source code similar to the above.
Also. Did you use the cordova-plugin-camera-sample-app from github? Last time I checked it was heavily outdated and many features did not work correctly.
regards Choppel
I just tested again with cordova-plugin-screen-orientation version 2.0.2 and the latest version of the camera preview and it always crashes when I pause the app after calling screen.orientation.lock.
Here is my config.xml: https://pastebin.com/BZ2MJiPm
@WeaponX86 It seems this issue only applies to your app which seems to be large, looking at the config.xml. No one else seems to have that problem. So I advise you to refactor your code. Every time I had a problem that no one else had, this resolved the issue for me.
@WeaponX86 I am having this issue as well.
@WeaponX86 @iisdan Hi, there seem to be different problems with the master version from github. Please try the version 0.9.0 directly from npm instead.
I am also facing the same issue. I am using screen orientation plugin to detect the device orientation. when the camera is open and if I put the app in background when it is in landscape mode and bringing back the app to foreground multiple times result to application crash. the device i am using for testing is Redmi Note 5. Attaching screenshots.

