react / react/react-native

Undefined symbol: _OBJC_CLASS_$_RCTRootView - Linker command failed with exit code 1 (use -v to see invocation)

Aperta
#44,749 0 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Issue: Author Provided Repro Needs: Triage :mag:
Lingua principale
C++
Stelle
127k
Fork
25.3k
Merge medio
1g 23h
PR unite (30g)
4

Descrizione

Description

I am trying to create Intent Extension but encountering an issue when building my project where the linker command fails with the following error message:

Showing All Issues
Undefined symbol: OBJC_CLASS$_RCTRootView
Linker command failed with exit code 1 (use -v to see invocation)

Steps to reproduce
  1. Clone the repository and navigate to the project directory.
  2. Run yarn
  3. Open the .xcworkspace file in Xcode.
  4. Select the extension scheme and build target.
  5. Attempt to build the project using Xcode.
React Native Version

0.74.1, & 0.72.4,

Affected Platforms

Runtime - iOS

Output of npx react-native info
System:
  OS: macOS 14.4.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 822.47 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.9.0
    path: ~/.nvm/versions/node/v20.9.0/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v20.9.0/bin/yarn
  npm:
    version: 10.1.0
    path: ~/.nvm/versions/node/v20.9.0/bin/npm
  Watchman:
    version: 2024.03.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/ahmed.quraishi/.rvm/gems/ruby-3.0.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 29.0.2
      - 30.0.3
      - 33.0.0
      - 34.0.0
    System Images:
      - android-29 | Google APIs ARM 64 v8a
      - android-30 | Google APIs ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
      - android-31 | Google Play ARM 64 v8a
      - android-33 | Google TV ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11076708
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 3.0.0
    path: /Users/ahmed.quraishi/.rvm/rubies/ruby-3.0.0/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.1
    wanted: 0.74.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
Stacktrace or Logs
Showing All Errors Only

Build target IntentExt of project extension with configuration Debug

Ld /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Products/Debug-iphonesimulator/IntentExt.appex/IntentExt normal (in target 'IntentExt' from project 'extension')
    cd /Users/ahmed.quraishi/Desktop/Projects/extension/ios
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios17.4-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk -O0 -L/Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -L/Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Products/Debug-iphonesimulator -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk/usr/lib/swift -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -F/Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -F/Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Products/Debug-iphonesimulator -F/Users/ahmed.quraishi/Desktop/Projects/extension/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F/Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built -filelist /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/Objects-normal/arm64/IntentExt.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/../../Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/Objects-normal/arm64/IntentExt_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -e _NSExtensionMain -fapplication-extension -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/Objects-normal/arm64/IntentExt.swiftmodule -lc++ -lc++abi -licucore -framework Accelerate -framework AudioToolbox -framework CFNetwork -framework JavaScriptCore -framework MobileCoreServices -framework Security -framework UIKit -framework hermes -ObjC -lc++ -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/IntentExt.appex-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __ents_der -Xlinker /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/IntentExt.appex-Simulated.xcent.der -framework PassKit -lPods-IntentExt -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/Objects-normal/arm64/IntentExt_dependency_info.dat -o /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Products/Debug-iphonesimulator/IntentExt.appex/IntentExt

ld: warning: ignoring duplicate libraries: '-lc++'
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_RCTRootView", referenced from:
       in IntentHandler.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: _OBJC_CLASS_$_RCTRootView

Linker command failed with exit code 1 (use -v to see invocation)



Build failed 
Reproducer

https://github.com/AhmadQuraishi/RNExtensionIssue.git

Screenshots and Videos
image

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Usa il riproduttore RNExtensionIssue collegato e apri il relativo iOS .xcworkspace in Xcode. Compila lo schema IntentExt, quindi esamina il riferimento di IntentHandler.o a RCTRootView e i pods e framework collegati dell’estensione. L’attività è completata quando il target IntentExt viene collegato correttamente senza l’errore di simbolo non definito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ios, react-native
Ambito
mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.