How to add EXCore for EXFaceDetector

I followed the instructions at the link below to add FaceDetector to a detached ExpoKit instance.
https://docs.expo.io/versions/latest/expokit/universal-modules-and-expokit.html#add-expo-face-detector-to-packagejson-and-install-js

However, when I run pod install I get the following error:
[!] Unable to find a specification for EXCore depended upon by EXFaceDetector
How do I satisfy this dependency? What are the steps?

Hunting around, I did find this:
https://github.com/expo/expo/blob/master/ExpoKit.podspec
In this ExpoKit.podspec file, I do see usage of the EXCore module, but I’m not sure how to add it… is it something I have to add via command line? Something I copy/paste directly into ExpoKit.podspec then re-run? Please advise!

Anyone, help… pls…

Hi @quadsurf,

Can you share your Podfile here? That would help me a lot to diagnose your problem :wink:

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

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

  pod 'React',
    :path => "../node_modules/react-native",
    :inhibit_warnings => true,
    :subspecs => [
      "Core",
      "ART",
      "RCTActionSheet",
      "RCTAnimation",
      "RCTCameraRoll",
      "RCTGeolocation",
      "RCTImage",
      "RCTNetwork",
      "RCTText",
      "RCTVibration",
      "RCTWebSocket",
      "DevSupport",
      "CxxBridge"
    ]
  pod 'yoga',
    :path => "../node_modules/react-native/ReactCommon/yoga",
    :inhibit_warnings => true
  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 'EXFaceDetector',
    :path => "../node_modules/expo-face-detector/ios",
    :inhibit_warnings => true


  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
    # Can't specify this in the React podspec because we need
    # to use those podspecs for detached projects which don't reference ExponentCPP.
    if target.pod_name.start_with?('React')
      target.native_target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
        config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
      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

thanks @tsapeta

Ok, so it looks like you’re using SDK28 (:tag => "ios/2.6.5" - this tag is for SDK28) and trying to use EXFaceDetector universal module which was not available in this SDK - they are available since SDK29.

Also, the link to the docs you provided is for the latest version of SDK, so it’s not your case. See here https://docs.expo.io/versions/v28.0.0/sdk/facedetector#methods to get more info on how to include FaceDetector in your build.

(not using SDK 28, using SDK 26)

How do you know that tag 2.6.5 is for SDK 28? I mean, how can I determine that on my own, when I can’t seem to find a chart that maps certain ExpoKit tags to Expo SDK releases. I only see releases (github[dot]com/expo/expo/releases)

anyway, thank you @tsapeta , but at the suggestion of github handle [@]terribleben (see link below), I had to change the tag to 2.6.5 in order to get rid of the FBNativeAd Property Title bug.
https://github.com/expo/expo/issues/1868#issuecomment-397008912

I have tried all sorts of combinations between SDK versions 25 & 26, tags 2.4.4 to 2.6.8, and CocoaPod versions 1.0 to @latest.

SDK 26 with ExpoKit tag 2.6.5 with CocoaPod 1.4 was the only combination that Xcode was able to run a build with… it was the only combination where I was at least able to open the app on my device. All other combinations failed to build. I would prefer starting at this starting point since it was furthest progress for me in my detachment efforts.

@tsapeta I went ahead and successfully upgraded to SDK 29 (from an undetached branch on SDK 26)… the upgrade was seamless, and the app still works perfectly throughout, but only on the Expo Client though. When I try detaching from SDK 29, the following happens:

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