I have tried all the solutions online for this error. I am unable to open the image gallery.
<Button
onPress={() =>
ImagePicker.launchImageLibrary(
{
mediaType: 'photo',
includeBase64: false,
maxHeight: 200,
maxWidth: 200,
},
response => {
console.log(response);
setPhoto(response);
},
)
}
title="Select Image"
/>
Solutions I have tried:
rm -rf node_modules
npm install
cd ios
pod install
cd ..
tried to change the import and how I call the launchImageLibrary
import * as ImagePicker from 'react-native-image-picker';
// import {launchImageLibrary} from 'react-native-image-picker';
Unfortunately I have not found a solution that works? Any ideas?
I have tried all the solutions online for this error. I am unable to open the image gallery.
<Button
onPress={() =>
ImagePicker.launchImageLibrary(
{
mediaType: 'photo',
includeBase64: false,
maxHeight: 200,
maxWidth: 200,
},
response => {
console.log(response);
setPhoto(response);
},
)
}
title="Select Image"
/>
Solutions I have tried:
rm -rf node_modules
npm install
cd ios
pod install
cd ..
tried to change the import and how I call the launchImageLibrary
import * as ImagePicker from 'react-native-image-picker';
// import {launchImageLibrary} from 'react-native-image-picker';
Unfortunately I have not found a solution that works? Any ideas?
Share Improve this question asked Jun 18, 2023 at 17:05 JasonBeedleJasonBeedle 4897 silver badges19 bronze badges 1- The fix was to ``` rm -rf node_modules npm install cd ios pod install cd .. ``` Then clean the build and rebuild the app. – JasonBeedle Commented Jun 18, 2023 at 20:20
3 Answers
Reset to default 3The fix was to
rm -rf node_modules
npm install
cd ios
pod install
cd ..
Then clean the build and rebuild the app.
My temporary solution after updating to Android SDK 33 is to upgrade react-native-image-picker to version 5.0.0 and use react-native-permissions package to handle READ_MEDIA_IMAGES permission.
You could stop the server and run the App with
react-native start --reset-cache
.
So you don't have to reinstall all your modules.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745468915a4629041.html
评论列表(0条)