'React/RCTView.h' file not found


#1

I have an ejected app and I am getting the above error.

I ran:

  • npm install
  • react-native link
  • pod install

I tried cleaning the project in XCode.

package.json

{
  "name": "myapp",
  "version": "0.10.8",
  "description": "MyApp",
  "private": true,
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "test": "node node_modules/jest/bin/jest.js --watch"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/vector-icons": "6.3.1",
    "axios": "0.17.1",
    "bson-objectid": "1.2.2",
    "clone": "2.1.1",
    "expo": "25.0.0",
    "fast-deep-equal": "^1.0.0",
    "lodash": "4.17.5",
    "moment": "2.20.1",
    "native-base": "2.3.8",
    "prop-types": "15.6.0",
    "query-string": "^5.1.0",
    "react": "^16.0.0",
    "react-addons-shallow-compare": "^15.6.2",
    "react-native": "https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz",
    "react-native-adjust": "^4.12.3",
    "react-native-app-intro": "https://github.com/merryjs/react-native-app-intro",
    "react-native-datepicker": "1.6.0",
    "react-native-easy-grid": "0.1.17",
    "react-native-fit-image": "1.5.4",
    "react-native-image-progress": "1.0.1",
    "react-native-markdown-text": "^1.0.1",
    "react-native-modal": "5.0.0",
    "react-native-pin-input": "1.3.2",
    "react-native-pinch-zoom-view": "^0.1.3",
    "react-native-simple-markdown": "1.1.0",
    "react-native-stager": "1.0.0",
    "react-native-star-rating": "1.0.8",
    "react-native-swiper": "^1.5.13",
    "react-native-vector-icons": "^4.5.0",
    "react-navigation": "1.0.0-beta.27",
    "react-redux": "5.0.6",
    "redux": "3.7.2",
    "redux-logger": "3.0.6",
    "redux-thunk": "2.2.0",
    "sentry-expo": "1.7.0",
    "slack-notify": "0.1.6",
    "validator": "9.4.0"
  },
  "devDependencies": {
    "eslint": "4.17.0",
    "eslint-config-airbnb": "16.1.0",
    "eslint-plugin-import": "2.8.0",
    "eslint-plugin-jsx-a11y": "6.0.3",
    "eslint-plugin-react": "7.6.1",
    "jest-expo": "25.1.0",
    "react-test-renderer": "16.2.0"
  }
}

pod file

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'

target 'otcme' do
  pod 'ExpoKit',
    :git => "http://github.com/expo/expo.git",
    :tag => "ios/2.3.3",
    :subspecs => [
      "Core",
      "CPP"
    ]

  pod 'React',
    :path => "../node_modules/react-native",
    :subspecs => [
      "Core",
      "ART",
      "RCTActionSheet",
      "RCTAnimation",
      "RCTCameraRoll",
      "RCTGeolocation",
      "RCTImage",
      "RCTNetwork",
      "RCTText",
      "RCTVibration",
      "RCTWebSocket",
      "DevSupport",
      "CxxBridge"
    ]
  pod 'yoga',
    :path => "../node_modules/react-native/ReactCommon/yoga"
  pod 'DoubleConversion',
    :podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec",
    :inhibit_warnings => true
  pod 'Folly',
    :podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec",
    :inhibit_warnings => true
  pod 'GLog',
    :podspec => "../node_modules/react-native/third-party-podspecs/GLog.podspec",
    :inhibit_warnings => true
  pod 'react-native-adjust', :path => '../node_modules/react-native-adjust'
  pod 'GoogleMaps', '~> 2.2.0'

  post_install do |installer|
    installer.pods_project.main_group.tab_width = '2';
    installer.pods_project.main_group.indent_width = '2';

    installer.pod_targets.each do |target|

    if target.pod_name == 'ExpoKit'
      target.native_target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'EX_DETACHED=1'
        # needed for GoogleMaps 2.x
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Maps/Frameworks'
      end
    end


    if ['Amplitude-iOS','Analytics','AppAuth','Branch','CocoaLumberjack','FBSDKCoreKit','FBSDKLoginKit','FBSDKShareKit','GPUImage','JKBigInteger2'].include? target.pod_name
      target.native_target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
      end
    end
    # Build React Native with RCT_DEV enabled
    next unless target.pod_name == 'React'
    target.native_target.build_configurations.each do |config|
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV=1'
    end

    end
  end
end

#2

delete ios/pods folder, then…

sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.4.0

and then…

pod install

then xcode compile works fine


#3

Hey there, sorry about the trouble. I just pushed a new ExpoKit tag ios/2.4.8 which fixes the CocoaPods issue. So you should be able to use the newer version of CocoaPods now if you want.


#4

I have this issue. Currently I am running: expo 25.0.0 with ExpoKit ios/2.3.3. Can I update ExpoKit without updating to expo 26.x.x?


#5

I have fixed this issue by updating to SDK 26 and ExpoKit ios/2.4.8, then applying this answer Upgrading to SDK 26 - Pod install issue


closed #6

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.