Cordova app crashes when the file access permission is denied

665 views Asked by At

For a cordova/phonegap app, I am using cordova-plugin-camera to fetch local files. and when invoking the navigator.camera.getPicture in android 6.0.1 devices a permission pop up appears asking permission to access files. On granting the permission its working. But when I deny the permission the app crashes. App gets closed and restarts automatically. Please help me to sort out the issue.

Thanks.

1

There are 1 answers

1
Prasanth Nath On

Here is the provider section in my Manifest XML file. You should add it inside the <application></application> tag

<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="ibas.provider"
android:exported="false"
android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/provider_paths" />
</provider>