response-native-share на iOS get не может прочитать свойство FACEBOOK из undefined - PullRequest
0 голосов
/ 06 мая 2020

Я получаю эту ошибку в симуляторе iOS, когда начал использовать react-native-share

enter image description here

cannot read property 'FACEBOOK' of undefined
RNShare
index.js:208:36
...

после запуска npm install Я бегу cd ios/ && pod install

это package.json часть

"dependencies": {
    "@react-native-community/datetimepicker": "2.2.2",
    "jetifier": "^1.6.5",
    "react": "16.12.0",
    "react-native": "0.61.5",
    "react-native-base64": "0.0.2",
    "react-native-device-info": "3.1.4",
    "react-native-gesture-handler": "1.4.1",
    "react-native-modal-datetime-picker": "8.5.1",
    "react-native-screens": "^2.7.0",
    "react-native-share": "^3.3.0",
    "react-native-vector-icons": "6.6.0",

и это часть подфайла

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'mobile' do

  ...

  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'

  ...

  pod 'RNShare', :path => '../node_modules/react-native-share'

1 Ответ

1 голос
/ 06 мая 2020

Поскольку вы используете версию RN 0.61, вам не нужно вручную добавлять RNShare в подфайл.

  1. Удалить pod 'RNShare', :path => '../node_modules/react-native-share' из файла пода
  2. Удалить pods папка и файл подлока внутри ios папка
  3. Выполнить pod install снова

https://github.com/react-native-community/react-native-share#automatic -way

...