Expo v26 ‘React/UIView+React.h’ file not found in ExpoKit/Core/AIRGMSPolygon.h


#1

I am trying to upgrade an iOS project from Expo v25 to v26 and I’m getting this error:
‘React/UIView+React.h’ file not found in this file ExpoKit/Core/AIRGMSPolygon.h.

I did pod install, pod update, removed podfile.lock file and Pods folder and did that again. In different combination, react-native link etc. I am out of options…

The app is detached. xcode 9.2, the rest is up to date.

Here is the contents of my Podfile:

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

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

  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 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  pod 'react-native-onesignal', :path => '../node_modules/react-native-onesignal'

  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 target.pod_name == 'AppAuth'
      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

Any help is appreciated.
Thanks.


#2

Hey @k6mediagroup,

If the library you are trying to link doesn’t have a spec file, you may have to configure your Header Search Paths. You can read more in the docs here: https://docs.expo.io/versions/v26.0.0/expokit/expokit#ios

Edit: Read below, the solution to this specific thread seems to be to use Cocoapods version 1.4.

Cheers,

Adam


#3

Thanks @adamjnav
Isn’t this looking like ExpoKit is not finding something and not a third library?
Thanks.

P.S. I have a few native libraries that I linked and added the search header paths etc., so I am aware of that. But here, it seems the problem comes from ExpoKit and I don’t have an option for that. I don’t see the ExpoKit project in my workspace/project.


#4

I updated the original post with the contents of my Podfile.


#5

Also seeing this… the header search paths were already there.


#6

I fixed this by adding the following search path to the end of the HEADER_SEARCH_PATHS in ExpoKit.xcconfig (inside Pods/ExpoKit/Support Files/ExpoKit.xcconfig):

"${PODS_ROOT}/Headers/Public/React"


#7

@jpstrikesback bless your heart! It fixes it for me too, but now I have “‘GoogleMaps/GoogleMaps.h’ file not found”. Strange, even if I have this in my Podfile:

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

#8

I have this some problem, but on application created with CRNA.


#9

@raisiqueira
I downgraded cocoapods to 1.4 and I think it is better now. I did had some other issues after that, but in the end I was able to build and run the app.


#10

Tnks, @k6mediagroup. I downgraded Pods to 1.4 and its works perfectly!


#11

I downgraded to 1.4 to resolve this issue but xcode keeps throwing:
Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: 244 duplicate symbols for architecture arm64

My error logs consist of duplicate instances of (replace symbol name):
duplicate symbol _OBJC_IVAR_$_RNSVGBezierTransformer._currentBezierIndex in:

Any ideas on how to resolve this?


#13

@wrightmk
Check for what library do you have that, chances are that you have it twice. Like in your project Libraries and then in Build Phases -> Link With Library. Remove the later one and try again. At least that’s how I solved it.


#14

@k6mediagroup the only library I have in Build Phases is libPods-terminal.a