Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build for iOS when use_frameworks linkage is set to dynamic #38333

Closed
atlj opened this issue Jul 13, 2023 · 2 comments
Closed

Cannot build for iOS when use_frameworks linkage is set to dynamic #38333

atlj opened this issue Jul 13, 2023 · 2 comments
Labels
Needs: Triage 🔍 Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@atlj
Copy link
Contributor

atlj commented Jul 13, 2023

Description

I've called use_frameworks with dynamic linkage on the Podfile and enabled the new architecture. After installing the pods, I've tried to build the app using XCode and I got the following build error:

Undefined symbol: facebook::react::ImageManager::requestImage(facebook::react::ImageSource const&, int) const
Click here for the full trace

Showing All Errors Only

Build target React-Fabric of project Pods with configuration Debug
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-Fabric' from project 'Pods')


Ld /Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-Fabric/React_Fabric.framework/React_Fabric normal (in target 'React-Fabric' from project 'Pods')
    cd /Users/burakguner/kod/testDynamicLatest/ios/Pods
    /Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-ios12.4-simulator -dynamiclib -isysroot /Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk -L/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Intermediates.noindex/EagerLinkingTBDs -L/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-Fabric -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Intermediates.noindex/EagerLinkingTBDs -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-Fabric -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/DoubleConversion -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/RCT-Folly -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/RCTTypeSafety -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-Core -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-cxxreact -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-debug -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-graphics -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-hermes -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-jsi -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-jsiexecutor -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-jsinspector -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-logger -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-perflogger -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-runtimescheduler -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-utils -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/ReactCommon -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/SocketRocket -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/Yoga -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/fmt -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/glog -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/libevent -F/Users/burakguner/kod/testDynamicLatest/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F/Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built -filelist /Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Fabric.build/Objects-normal/arm64/React_Fabric.LinkFileList -install_name @rpath/React_Fabric.framework/React_Fabric -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Fabric.build/Objects-normal/arm64/React_Fabric_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -stdlib\=libc++ -fobjc-arc -fobjc-link-runtime -framework DoubleConversion -framework JavaScriptCore -framework RCTTypeSafety -framework React -framework ReactCommon -framework React_debug -framework React_graphics -framework React_runtimescheduler -framework React_utils -framework folly -framework glog -framework hermes -framework jsi -framework jsireact -framework logger -framework yoga -framework Foundation -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Fabric.build/Objects-normal/arm64/React_Fabric_dependency_info.dat -o /Users/burakguner/Library/Developer/Xcode/DerivedData/testDynamicLatest-ccdudyxjtfwmbvgujomkmpjyasud/Build/Products/Debug-iphonesimulator/React-Fabric/React_Fabric.framework/React_Fabric

Undefined symbols for architecture arm64:
  "facebook::react::ImageManager::requestImage(facebook::react::ImageSource const&, int) const", referenced from:
      facebook::react::ImageShadowNode::updateStateIfNeeded() in ImageShadowNode.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Undefined symbol: facebook::react::ImageManager::requestImage(facebook::react::ImageSource const&, int) const



Build failed    13.07.2023 12:40    45.1 seconds

React Native Version

0.72.3

Output of npx react-native info

System:
  OS: macOS 12.6
  CPU: (10) arm64 Apple M1 Pro
  Memory: 103.02 MB / 16.00 GB
  Shell:
    version: 5.8.1
    path: /bin/zsh
Binaries:
  Node:
    version: 18.16.1
    path: /opt/homebrew/opt/node@18/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 9.5.1
    path: /opt/homebrew/opt/node@18/bin/npm
  Watchman:
    version: 2023.07.03.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.0
    path: /opt/homebrew/lib/ruby/gems/2.7.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.2
      - iOS 16.2
      - macOS 13.1
      - tvOS 16.1
      - watchOS 9.1
  Android SDK: Not Found
IDEs:
  Android Studio: Electric Eel 2022.1.1 Patch 1 Electric Eel 2022.1.1 Patch 1
  Xcode:
    version: 14.2/14C18
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.16.1
    path: /usr/bin/javac
  Ruby:
    version: 2.7.8
    path: /opt/homebrew/opt/ruby@2.7/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.3
    wanted: 0.72.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: true

Steps to reproduce

  1. Create a new react native app using react-native init
  2. Go to the Podfile, and add the following lines:
ENV["RCT_NEW_ARCH_ENABLED"]="1"
ENV['NO_FLIPPER'] = '1'
ENV['USE_FRAMEWORKS'] = 'dynamic'
  1. Install the npm modules
  2. Install the pods
  3. Build the app via XCode

Snack, code example, screenshot, or link to a repository

https://github.com/atlj/rn-new-arch-dynamic-linkage-issue

@atlj atlj added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Jul 13, 2023
@github-actions github-actions bot added the Platform: iOS iOS applications. label Jul 13, 2023
@troZee
Copy link
Contributor

troZee commented Jul 13, 2023

@atlj Could you check, if it is related to reactwg/react-native-new-architecture#115 ?

@atlj
Copy link
Contributor Author

atlj commented Jul 13, 2023

As @troZee told, I'm closing this in favor of reactwg/react-native-new-architecture#115.

@atlj atlj closed this as completed Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

2 participants