expo-image-picker freezes after selecting an image and hitting the "choose" button( M1 chip Macbook running Big Sur)
See original GitHub issue🐛 Bug Report
Summary of Issue
expo-image-picker freezes after selecting an image and hitting the “choose” button. It works as expected on a physical device and on a 2018 macbook pro. However it does not work in the IOS simulator on an M1 Chip Macbook Air(Big Sur). I have tried restarting my device, re-downloaded xcode, change some settings etc. Nothing seems to work. I replicated this issue in 2 different project now.
Environment - output of expo diagnostics & the platform(s) you’re targeting
Expo CLI 4.0.11 environment info: System: OS: macOS 11.0 Shell: 5.8 - /bin/zsh Binaries: Node: 14.15.1 - /usr/local/bin/node Yarn: 1.22.5 - ~/.yarn/bin/yarn npm: 6.14.8 - /usr/local/bin/npm Managers: CocoaPods: 1.10.0 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1 IDEs: Android Studio: 4.1 AI-201.8743.12.41.6953283 Xcode: 12.2/12B45b - /usr/bin/xcodebuild npmPackages: expo: ^38.0.0 => 38.0.9 react: 16.11.0 => 16.11.0 react-dom: 16.11.0 => 16.11.0 react-native: https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz => 0.62.2 react-native-web: ~0.11.7 => 0.11.7 react-navigation: ^4.4.0 => 4.4.0 npmGlobalPackages: expo-cli: 4.0.11 Expo Workflow: managed
Reproducible Demo
import * as ImagePicker from 'expo-image-picker'
export default function App() {
useEffect(() => {
(async () => {
if (Platform.OS !== 'web') {
const { status } = await ImagePicker.requestCameraRollPermissionsAsync()
console.log(status)
if (status !== 'granted') {
alert('Sorry, we need camera roll permissions to make this work!')
}
}
})()
}, [])
const _pickImage = async (screen: string) => {
try {
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.All,
allowsEditing: true,
aspect: [4, 3],
quality: 1,
})
} catch (error) {
}
}
return (
<View style={styles.container}>
<Button title="pick Image" color="black" onPress={_pickImage}/>
</View>
);
}
Steps to Reproduce
expo init camera-test- open project
yarn add expo-image-picker- add the code to ask permission and code to launch image picker
yarn start- press I key when loaded for IOS simulator
- project loads on IOS simulator device(Iphone 12 pro)
- click button to open image library
- click a picture from the library
- Image cropping tool comes up(I am able to crop the image and click cancel button)
- click the “choose” button
- BUG --> IOS simulator freezes(unable to click anything or do anything at all)
Expected Behavior vs Actual Behavior
Expected Behavior: Able to choose an image from the image library. Actual Behavior: Choosing an image causes the IOS simulator to freeze and I am unable to do anything.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:12 (3 by maintainers)
Top Related StackOverflow Question
I’m facing the same thing on iPhone 12 simulator on M1 chip mac. Any updates/fixes on this issue?
Same issue. M1 iOS 12 Max