[expo-image-picker] undefined is not an object
See original GitHub issueSummary
undefined is not an object (evaluating ‘_ExponentImagePicker.default.requestMediaLibraryPermissionsAsync’)
Here’s the code 💻
// Camera & Image Picker
import * as ImagePicker from 'expo-image-picker';
const openImagePicker = async () => {
try {
// Ask the user for the permission to access the media library
const permissionResult = await ImagePicker.requestMediaLibraryPermissionsAsync()
if (permissionResult.granted === false) {
alert("You've refused to allow this appp to access your photos!");
return;
}
const result = await ImagePicker.launchImageLibraryAsync();
// Explore the result
console.log(result);
if (result.cancelled === false) {
setPickedImagePath(result.uri);
console.log(result.uri);
}
} catch (error) {
alert('Error Occur: ' + error.message)
closeSheet()
}
}
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
44
Environment
Expo CLI 5.0.3 environment info: System: OS: macOS 12.2 Shell: 5.8 - /bin/zsh Binaries: Node: 14.18.1 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 6.14.15 - /usr/local/bin/npm Watchman: 2022.01.17.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 IDEs: Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild npmPackages: expo: ^44.0.0 => 44.0.5 react: ^17.0.2 => 17.0.2 react-dom: ^17.0.2 => 17.0.2 react-native: ~0.63.4 => 0.63.4 react-native-web: ~0.13.12 => 0.13.18 npmGlobalPackages: eas-cli: 0.45.1 expo-cli: 5.0.3 Expo Workflow: bare
Reproducible demo
https://i.stack.imgur.com/xOacj.png
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
As i experienced it only on the standalone version, I tried rebuilding my app and publishing it again (ios) and it worked. I didnt need to downgrade (using expo 44).
I managed to fix that by downgrading expo to 42, just a workaround not the explicit solution.