Expokit项目ImagePicker可在Expo中工作,但不能在build apk中工作。此代码未在apk中响应,但在expo中工作。为什么会这样呢?
pickFromGallery = async () => {
const permissions = Permissions.CAMERA_ROLL;
const { status } = await Permissions.askAsync(permissions);
console.log(permissions, status);
if (status === 'granted') {
let result = await ImagePicker.launchImageLibraryAsync({
allowsEditing: true,
aspect: [4, 4],
});
if (!result.cancelled) {
this.setState({ photo: result });
}
}
};