question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error building with use_frameworks in Expo 39

See original GitHub issue

🐛 Bug Report

Summary of Issue

Enabling use_frameworks! with Expo 39 causes the build fail in Xcode. This happens using the bare-minimal template, and appears to be an issue with the linking of react-native-screens and react-native-gesture-handler.

Environment - output of expo diagnostics & the platform(s) you’re targeting

  Expo CLI 3.28.2 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
      Yarn: 1.19.1 - /usr/local/bin/yarn
      npm: 6.14.4 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.10.0 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
      Android SDK:
        API Levels: 23, 25, 26, 27, 28
        Build Tools: 23.0.1, 23.0.2, 25.0.2, 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.1, 29.0.2
        System Images: android-26 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 4.0 AI-193.6911.18.40.6626763
      Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~39.0.2 => 39.0.3
      react: 16.13.1 => 16.13.1
      react-dom: 16.13.1 => 16.13.1
      react-native: ~0.63.3 => 0.63.3
      react-native-web: ~0.13.12 => 0.13.18
    npmGlobalPackages:
      expo-cli: 3.28.2
    Expo Workflow: bare

Reproducible Demo

Demo project created using the steps below: https://github.com/carsondarling/expo39_use_frameworks_error_demo

Steps to Reproduce

  1. expo init --npm --template bare-minimum
  2. Update Podfile to enable use_frameworks! and remove Flipper:
# ios/Podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'

target 'expo39useframeworkserrordemo' do
  use_frameworks!
  use_unimodules!
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])
end
  1. cd ios && pod install
  2. Attempting to build in Xcode now fails when linking react-native-screens and react-native-gesture-handler with the errors below:
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RCTFont", referenced from:
      objc-class-ref in RNSScreenStackHeaderConfig.o
  "_RCTIsMainQueue", referenced from:
      -[RNSScreenContainerManager markUpdated:] in RNSScreenContainer.o
  "__RCTAssertFormat", referenced from:
      -[RNSScreenContainerManager markUpdated:] in RNSScreenContainer.o
      -[RNSScreenStackView setModalViewControllers:] in RNSScreenStack.o
  "_OBJC_CLASS_$_RCTRootContentView", referenced from:
      objc-class-ref in RNSScreenStack.o
  "_RCTRegisterModule", referenced from:
      +[RNSScreenManager load] in RNSScreen.o
      +[RNSScreenContainerManager load] in RNSScreenContainer.o
      +[RNSScreenStackManager load] in RNSScreenStack.o
      +[RNSScreenStackHeaderConfigManager load] in RNSScreenStackHeaderConfig.o
      +[RNSScreenStackHeaderSubviewManager load] in RNSScreenStackHeaderConfig.o
  "_OBJC_CLASS_$_RCTConvert", referenced from:
      __OBJC_$_CATEGORY_RCTConvert_$_RNSScreen in RNSScreen.o
      __OBJC_$_CATEGORY_RCTConvert_$_RNSScreenStackHeader in RNSScreenStackHeaderConfig.o
  "_OBJC_CLASS_$_RCTRootView", referenced from:
      objc-class-ref in RNSScreen.o
  "_OBJC_METACLASS_$_RCTViewManager", referenced from:
      _OBJC_METACLASS_$_RNSScreenManager in RNSScreen.o
      _OBJC_METACLASS_$_RNSScreenContainerManager in RNSScreenContainer.o
      _OBJC_METACLASS_$_RNSScreenStackManager in RNSScreenStack.o
      _OBJC_METACLASS_$_RNSScreenStackHeaderConfigManager in RNSScreenStackHeaderConfig.o
      _OBJC_METACLASS_$_RNSScreenStackHeaderSubviewManager in RNSScreenStackHeaderConfig.o
  "_OBJC_METACLASS_$_RCTView", referenced from:
      _OBJC_METACLASS_$_RNSScreenView in RNSScreen.o
  "_RCTExecuteOnMainQueue", referenced from:
      -[RNSScreenContainerManager markUpdated:] in RNSScreenContainer.o
  "_OBJC_CLASS_$_RCTTouchHandler", referenced from:
      objc-class-ref in RNSScreen.o
  "_OBJC_CLASS_$_RCTView", referenced from:
      _OBJC_CLASS_$_RNSScreenView in RNSScreen.o
  "_OBJC_CLASS_$_RCTViewManager", referenced from:
      _OBJC_CLASS_$_RNSScreenManager in RNSScreen.o
      _OBJC_CLASS_$_RNSScreenContainerManager in RNSScreenContainer.o
      _OBJC_CLASS_$_RNSScreenStackManager in RNSScreenStack.o
      _OBJC_CLASS_$_RNSScreenStackHeaderConfigManager in RNSScreenStackHeaderConfig.o
      _OBJC_CLASS_$_RNSScreenStackHeaderSubviewManager in RNSScreenStackHeaderConfig.o
  "_RCTConvertEnumValue", referenced from:
      +[RCTConvert(RNSScreen) RNSScreenStackPresentation:] in RNSScreen.o
      +[RCTConvert(RNSScreen) RNSScreenStackAnimation:] in RNSScreen.o
      +[RCTConvert(RNSScreen) RNSScreenReplaceAnimation:] in RNSScreen.o
      +[RCTConvert(RNSScreenStackHeader) RNSScreenStackHeaderSubviewType:] in RNSScreenStackHeaderConfig.o
      +[RCTConvert(RNSScreenStackHeader) UIBlurEffectStyle:] in RNSScreenStackHeaderConfig.o
  "__RCTLogNativeInternal", referenced from:
      -[RNSScreenView setStackPresentation:] in RNSScreen.o
      -[RNSScreenStackView insertReactSubview:atIndex:] in RNSScreenStack.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RCTScrollView", referenced from:
      objc-class-ref in RNNativeViewHandler.o
  "__RCTAssertFormat", referenced from:
      -[RNGestureHandlerRegistry attachHandlerWithTag:toView:] in RNGestureHandlerRegistry.o
  "_OBJC_METACLASS_$_RCTViewManager", referenced from:
      _OBJC_METACLASS_$_RNGestureHandlerButtonManager in RNGestureHandlerModule.o
  "_OBJC_CLASS_$_RCTEventEmitter", referenced from:
      _OBJC_CLASS_$_RNGestureHandlerModule in RNGestureHandlerModule.o
  "__RCTNotImplementedException", referenced from:
      -[RNGestureHandlerEvent init] in RNGestureHandlerEvents.o
      -[RNGestureHandlerStateChange init] in RNGestureHandlerEvents.o
  "_RCTGetUIManagerQueue", referenced from:
      -[RNGestureHandlerModule methodQueue] in RNGestureHandlerModule.o
  "_OBJC_CLASS_$_RCTConvert", referenced from:
      objc-class-ref in RNFlingHandler.o
      objc-class-ref in RNForceTouchHandler.o
      objc-class-ref in RNGestureHandler.o
      objc-class-ref in RNGestureHandlerModule.o
      objc-class-ref in RNLongPressHandler.o
      objc-class-ref in RNNativeViewHandler.o
      objc-class-ref in RNPanHandler.o
      ...
  "_RCTRegisterModule", referenced from:
      +[RNGestureHandlerButtonManager load] in RNGestureHandlerModule.o
      +[RNGestureHandlerModule load] in RNGestureHandlerModule.o
  "_OBJC_CLASS_$_RCTRootView", referenced from:
      objc-class-ref in RNGestureHandlerManager.o
  "_RCTDefaultLogFunction", referenced from:
      -[RNGestureHandlerManager registerRootViewIfNeeded:] in RNGestureHandlerManager.o
      -[RNGestureHandlerManager dealloc] in RNGestureHandlerManager.o
  "_OBJC_METACLASS_$_RCTEventEmitter", referenced from:
      _OBJC_METACLASS_$_RNGestureHandlerModule in RNGestureHandlerModule.o
  "_OBJC_CLASS_$_RCTTouchHandler", referenced from:
      objc-class-ref in RNRootViewGestureRecognizer.o
  "_OBJC_CLASS_$_RCTViewManager", referenced from:
      _OBJC_CLASS_$_RNGestureHandlerButtonManager in RNGestureHandlerModule.o
  "__RCTLogNativeInternal", referenced from:
      -[RNGestureHandler configure:] in RNGestureHandler.o
      -[RNGestureHandlerManager createGestureHandler:tag:config:] in RNGestureHandlerManager.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Expected Behavior vs Actual Behavior

Expected: Able to use use_frameworks! with Expo 39 Actual: Build fails as soon as use_frameworks! is added

It’s entirely possible that I’m missing some key step here, but I’ve been staring at this for a while now and haven’t been able to come up with a solution.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
carsondarlingcommented, Oct 29, 2020

@brentvatne I’ll certainly look into it. Unfortunately I’m pretty much completely swamped right now so the raw hours I’ll have available. to put into it are fairly minimal in the short term.

Thanks again your help!

1reaction
matteocargnelutticommented, Oct 29, 2020

I am impacted by this issue as well. Thanks in advance,

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do we use use_frameworks! in CocoaPods?
use_frameworks ! tells CocoaPods that you want to use Frameworks instead of Static Libraries. Since Swift does not support Static Libraries you have...
Read more >
Installation - React Native Google Mobile Ads
Under the "Apps" menu item, create or choose an existing Android/iOS app. Each app platform exposes a unique account ID which needs to...
Read more >
target has transitive dependencies that include statically linked ...
I have some pods that they are using use_frameworks!, as consequence i can't remove the line, then it generates the next error.
Read more >
expo-contacts - NPM Package Compare versions - Socket
Start using Socket to analyze expo-contacts and its 3 dependencies to secure ... Fix building errors from use_frameworks! in Podfile. ... -39,0 +32,0...
Read more >
expo | Yarn - Package Manager
The expo package is a single package you can install in any React Native app to begin using Expo modules. includes core infrastructure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found