Expokit项目ImagePicker可在EXPO中工作,但不能在构建APK中工作

时间:2019-04-27 22:06:47

标签: react-native expo

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 });

            }
        }
    };

0 个答案:

没有答案