New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image picker issues on Android #627
Comments
Hi! Can you provide an example of your code where this is happening? Maybe using Snack? Thanks! |
Same problem (two samsung different model, one launch, one not) |
@aalices is this something you're familiar with? Not sure |
I'm having the same issue. let result = await ImagePicker.launchCameraAsync({
allowsEditing: true,
aspect: [3, 4],
base64: true
}); On Android, this code will work on the Expo app, but will fail in the compiled standalone APK. The error I get is that the user rejected the permissions (but I accepted them). Printing a
The same works fine on iPhone, though. |
@divyakoshy @akazimir @ledfusion I tested this on Xiaomi 4a, Nexus 5 and Samsung Galaxy Tab S2 and everything's fine. What devices are you using ? |
Hi @aalices, The following catch block: catch (err) {
Alert.alert("ERROR", (err && err.message) + "\n" + JSON.stringify(err));
} Shows: Thank you |
@aalices, Xiaomi Redmi 4 Prime (android 6.0.1), but I have no error in try-catch, just nothing happens and promise awaits result, permission in console.log - Object {expires: "never", status: "granted"} |
Switching to the Expo's camera component, and the problem is gone: |
Apologies for the delay in responding. I was able to fix this issue by removing all Permissions for android in app.json. |
@akazimir looks like the other reporters resolved this by using the Camera component or by changing their permissions in app.json. Can you double check that you haven't removed the necessary permissions in app.json? Since the original report has been resolved, going to give this a close. If it's still an issue and we have a reproduction, I'll happily reopen. Thanks! |
@dikaiosune, I still see the same issue. I have the following permissions in app.json. Am I missing something here? {
"android": {
"permissions": [
"CAMERA",
"READ_INTERNAL_STORAGE",
"READ_EXTERNAL_STORAGE",
"WRITE_EXTERNAL_STORAGE"
]
}
} |
@rintoj a new type of permission that you will be able to use via |
I have same issue. This one was working fine: /**
* Get picture from camera
*/
async _takePicture() {
const result = await ImagePicker.launchCameraAsync()
if (!result.cancelled) {
await this._setImage(result.uri)
}
} But NOT for this one: /**
* Select picture from image library
*/
async _selectPicture() {
const result = await ImagePicker.launchImageLibraryAsync()
if (!result.cancelled) {
await this._setImage(result.uri)
}
} Nothing happens after image get selected -- I don't see any exception been thrown. I've tested on Android only using Xiaomi Redmi 2 Prime -- not sure about IOS. I've made dummy project to reproduce this issue here: https://github.com/budiadiono/react-native-expo-image-picker-demo. Published here: https://expo.io/@budiadiono/image-picker-demo. Previously I was also trying to play with permissions things as discussed above but it didn't helps. Any clue? |
@budiadiono fix in on it's way. Thanks! This was not related to previous reports anyway. |
@aalices Any updates? running into the same issue. |
@donedgardo it is not yet merged. Not sure if there will be a minor release or it will be fixed in next SDK, @terribleben ? |
@aalices This still isn't fixed. Why was the issue closed? |
Hello recent repliers! We don't think recent comments are related to the original issue in this thread, "Image picker issues on Android", opened last September, since the author of the issue was able to resolve their problem without us changing anything. We've made lots of changes to this code in the last five months. If you have a new bug to report with ImagePicker, please open a new thread and follow the issue template. |
ImagePicker.launchImageLibraryAsync() and ImagePicker.launchCameraAsync() do not seem to work on Android standalone apps. The permissions are requested correctly, but the async calls never return and the view for taking/picking photos never appears.
Permissions have been put into the app.json, and on iOS things are working correctly. Not sure what I am missing D:
The text was updated successfully, but these errors were encountered: