react-native-camera-roll-picker icon indicating copy to clipboard operation
react-native-camera-roll-picker copied to clipboard

Cannot read property of 'getPhotos' of underfined

Open 73R3WY opened this issue 4 years ago • 2 comments

"dependencies": { "@react-native-community/cameraroll": "^1.3.0", ..., "react-native-camera-roll-picker": "2.0.0", ..., }

Using react 16.9.0 Using react-native Expo SDK 36

Referencing:

  • https://github.com/jeanpan/react-native-camera-roll-picker/issues/99
  • https://github.com/jeanpan/react-native-camera-roll-picker/pull/102

Having a console log before

    CameraRoll.getPhotos(fetchParams)
      .then(data => this.appendImages(data), e => console.log(e));

will show that CameraRoll is not undefined.

My view definition is something like this:

      <TouchableOpacity
        style={[styles.container, this.props.containerStyle]}
        onPress={this.onActionsPress}
      >
        <Modal
          animationType={"slide"}
          transparent={false}
          visible={this.state.modalVisible}
          onRequestClose={() => {
            this.setModalVisible(false);
          }}
        >
          {this.renderNavBar()}
          <CameraRollPicker
            maximum={10}
            imagesPerRow={4}
            callback={this.selectImages}
            selected={[]}
          />
        </Modal>
        {this.renderIcon()}
      </TouchableOpacity>

73R3WY avatar Apr 04 '20 08:04 73R3WY

Did you do link correctly like pod install?

theasc avatar Apr 20 '20 10:04 theasc

Yes @theasc , I even linked the libraries manually and executed pod install on ios.

73R3WY avatar Apr 20 '20 11:04 73R3WY