Media Library permissions

Hi everyone,

I used “expo-media-library”: “^8.1.0”, SDK: 37.0.12. My problem is after build the android APK I’m getting camera_Roll permission as CanAskagain: true and status: undetermined. Below is the code.

Thanks.

registerForCameraRollAsync = async () => {

if (Constants.isDevice) {
const { status, canAskAgain } = await Permissions.getAsync(Permissions.CAMERA_ROLL);
if (status !== ‘granted’) {
const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL);
alert(‘Sorry, we need camera roll permissions to make this work!’);
}
} else {
alert(‘Must use physical device for Push Notifications’);
}

};

https://docs.expo.io/versions/latest/sdk/imagepicker/

You can try this. It works properly even after APK build.

Hi,

This is media library permissions issue. i forgot to insert “READ_EXTERNAL_STORAGE” permissions in app.json.

Thanks.

“android”: {
“package”: “com.sample.learning”,
“versionCode”: 1,
“permissions”: [
“READ_EXTERNAL_STORAGE”
],
“googleServicesFile”: “./google-services.json”
},

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.