App crash when accessing camera in android 9

Hi,

I am new to ionic cordova and I am having some trouble with the cordova camera plugin. I made an app to stream to my server and it works well with android 7 and below but with android 9 when I try to access the camera the app crashes then if i reopen the app it does not respond.

I have tried debugging the app using chrome developer tools but I am not able to get the error generated. Has anyone else had trouble with camera access?

If so how did you resolve it?

My app module code is:

.....
import { Camera } from '@ionic-native/camera';import { Camera } from '@ionic-native/camera';
.....

  providers: [
   ..........
    Camera,
    ........
  ]


This is my android manifest

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="50700" android:versionName="5.7" package="mobile.stream.test" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:usesCleartextTraffic="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="org.apache.cordova.camera.FileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/camera_provider_paths" />
        </provider>
        <receiver android:enabled="true" android:name="nl.xservices.plugins.ShareChooserPendingIntent">
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
            </intent-filter>
        </receiver>
    </application>
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.FLASHLIGHT" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-feature android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.camera2.full" android:required="false" />
    <uses-feature android:name="android.hardware.camera2.autofocus" android:required="false" />
    <uses-permission android:name="com.amazon.device.messaging.permission.RECEIVE" />
    <permission android:name="mobile.twendesmart.com.permission.RECEIVE_ADM_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="mobile.twendesmart.com.permission.RECEIVE_ADM_MESSAGE" />
</manifest>

Try appending “/ngx” to that import path.