Permissions weren't granted on Android
See original GitHub issueI’m testing an app which is using react-native-image-picker on my Android devices. It’s working on iOs, not on Android.
Here’s what I’ve done:
export function getImageFromLibrary () {
let options = {
quality: 1.0,
maxWidth: 500,
maxHeight: 500,
storageOptions: {
skipBackup: true
}
};
return dispatch => {
dispatch(requestImageFromLibrary())
return ImagePicker.showImagePicker(options, (response) => {
let responseObj = {};
if (response.didCancel || response.error) {
responseObj = {
success: false,
errorMessage: response.error,
uri: response.uri
};
dispatch(receiveImageFromLibraryErr(responseObj));
}
else {
responseObj = {
success: true,
uri: response.uri
};
dispatch(receiveImageFromLibrary(responseObj));
// let source = { uri: 'data:image/jpeg;base64,' + response.data };
}
});
}
}
<TouchableOpacity onPress={this.props.getImageFromLibrary}>
<Text>Choose picture</Text>
</TouchableOpacity>
Here’s what happen:
- I can tap the Choose picture
- it opens the “Select a photo” menu
- whether I tap Take photo or Choose from library, it logs an error “Permissions not granted”
I uninstalled the app / reinstalled it, checked my application permissions in Android settings, but it never ask me for more permissions.
What do I miss? Should I use another module, like https://github.com/yonahforst/react-native-permissions?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Change app permissions on your Android phone - Google Help
On your phone, open the Settings app. · Tap Privacy And then Permission manager. · Tap a permission type. If you allowed or...
Read more >Error: Permissions not granted... react-native-image-picker
The accepted answer won't work if you are using Android M or API level 23+, You need to ...
Read more >App permissions were not accepted - Device Tracker Plus
As with any app, during the set-up process we ask you to accept certain app permissions to allow Device Tracker Plus to work....
Read more >Why are Android permissions granted in groups?
So basically anything that wants to use the device with an elevated privilege has to have explicit permission from the user. Most users,...
Read more >Solar2D Native | Android | Runtime Permission Support
About Android Runtime Permissions · If the device is running Android 5.1 or lower, permissions are granted on app install. No runtime checks...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any lucky on this?
Checkout your AndroidManifest.xml and see if it has these lines of code:
This library already handle Android permissions, you don’t need any other permission library for use it.
I added
and it works for me