The app build with no error at all, but when the app tries to open it crash automatically.
Same here - Just installed the package and cannot open the app afterwards, no errors, nothing
You'll need to add more info to get any help.
Did you complete the steps in https://github.com/react-native-community/react-native-image-picker/blob/master/docs/Install.md
The app will crash if you don't set permissions.
I had the same problem while installing 1.0.1. It has a breaking change due to AndroidX support.
Just rollback to 0.28.0 for the simplest solution.
same problem,because of the reference to androidx , you just rollback to 0.28.1
face the same issue, there is no errors display in the console. but app crash automaticaly
same here, after capture image app restart automatically.
Same here.
Roll back worked.
No log errors, nothing, a plain crash(the app didnt even started ).
I am facing same issue mentioned above in heading. To revert back is not good solution there should be proper solution.
If you want to support AndroidX, then you have to migrate your android project (along with all your other dependencies) to AndroidX. Alternatively, you use jetifier, which will 'automagically' do this for all your third-party dependencies.
same here
same here, but i can't find the solution, can someone tell me ?
一样的问题,搞了两天还是没有解决
I had the same problem while installing 1.0.1. It has a breaking change due to AndroidX support.
Just rollback to 0.28.0 for the simplest solution.
thanks for help . this worked for me
For anyone needs help rolling back, try
npm uninstall react-native-image-picker
npm install [email protected]
but 1.x.x is mandatary for react native 0.59 or above. any solution for this ?
If you want to support AndroidX, then you have to migrate your android project (along with all your other dependencies) to AndroidX. Alternatively, you use jetifier, which will 'automagically' do this for all your third-party dependencies.
still crash silently
Apart from the AndroidX support, v0.28.1 has the same features as v1.0.1
but 1.x.x is mandatary for react native 0.59 or above. any solution for this ?
same (issue #1149 ) . am using RN 0.60.4, need the androidx support.
Anyone tested 0.28.1 works with RN >0.59? Jetifier works right? ( I don't want to break my current build)
I had same issue with my Google Pixel 2 XL, with RN 0.59.10 and ImagePicker 0.28.0. I spent five days to figure out and research, no luck.
I gave up this. Currently I'm using expo 34 with expo-image-picker. I did try pure react native 0.59.9 with expo-image-picker too and it worked well.
So I found that for me it wasn't asking for permissions so whenever I tried to access image-picker the app would restart.
I was able to fix it by manually asking for permissions with expo-permissions, something like this:
import * as Permissions from 'expo-permissions';
getPermissions = async () => {
if (Platform.OS !== 'ios') {
let { status } = await Permissions.askAsync(Permissions.CAMERA);
if (status !== 'granted') {
this.setState({
error:
'Please grant permissions to be able to upload your profile picture.',
});
return false;
}
const { status: cameraRollStatus } = await Permissions.askAsync(
Permissions.CAMERA_ROLL
);
if (cameraRollStatus !== 'granted') {
this.setState({
error:
'Please grant permissions to be able to upload your profile picture.',
});
return false;
}
}
return true;
};
before calling ImagePicker.showImagePicker
I too had my apps crashing when selecting photos. I was just trying my luck with try/catch in the screen. For some unkonwn reason it worked. Here is my code
handleChoosePhoto = () => {
const options = {
noData: true,
quality: 1,
maxWidth: 200,
maxHeight: 200,
}
try{
ImagePicker.launchImageLibrary(options, response => {
if (response.uri) {
this.setState({ photo: response })
}
});
}
catch(e) { console.error(e); }
}
Adding this code to AndroidManifest.xml worked for me. (Crash in android 9 after taking image)
<uses-feature android:name="android.hardware.camera.any" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
...
android:largeHeap="true" >
</application>
not work for me
Resolved the issue on my end by rolling back to 0.28 and , manually running Jetifier through the postinstall script -> "postinstall": "npx jetify". Using the latest 0.61.5 RN
This worked for me.
Just delete node_modules and reinstall all the packages.
This worked for me.
Just delete node_modules and reinstall all the packages.
what is react native version ?
In case it is useful for anyone if you have set the option quality and you select a video, on android it crashes.
I end up with something like
{
noData: true,
durationLimit: config.VIDEO_LIMIT_DURATION,
allowsEditing: true,
mediaType: 'mixed',
...Platform.select({
ios: {
quality: 0.5,
videoQuality: 'medium'
},
android: {
videoQuality: 'low'
}
})
}
Most helpful comment
For anyone needs help rolling back, try
npm uninstall react-native-image-pickernpm install [email protected]