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

Fix errors when compiling with Swift file on iOS lower than 14 #315

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

maksg
Copy link
Contributor

@maksg maksg commented Apr 15, 2024

Details

If a Swift file was added to the project with podspec target set to iOS 13 and lower, the app wouldn't compile and would throw file not found errors.

@tomekzaw
Copy link
Collaborator

tomekzaw commented Apr 16, 2024

@staszekscp Could you please check if this change works correctly with static/dynamic linking in the hybrid app?

@tomekzaw tomekzaw requested a review from j-piasecki April 18, 2024 09:54
@@ -30,6 +30,5 @@ Pod::Spec.new do |s|
s.subspec "common" do |ss|
ss.source_files = "cpp/**/*.{cpp,h}"
ss.header_dir = "RNLiveMarkdown"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/cpp\"" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you've checked, but just to make sure: this doesn't break the new arch build, right?

@tomekzaw
Copy link
Collaborator

  • NO_FLIPPER=1 USE_FRAMEWORKS=static pod install
  • NO_FLIPPER=1 USE_FRAMEWORKS=static RCT_NEW_ARCH_ENABLED=1 pod install
  • NO_FLIPPER=1 USE_FRAMEWORKS=dynamic pod install 🔴
ld: Undefined symbols:
  _OBJC_CLASS_$_RCTBackedTextFieldDelegateAdapter, referenced from:
      __OBJC_$_CATEGORY_RCTBackedTextFieldDelegateAdapter_$_Markdown in RCTBackedTextFieldDelegateAdapter+Markdown.o
  _OBJC_CLASS_$_RCTBaseTextInputView, referenced from:
       in MarkdownTextInputDecoratorView.o
      __OBJC_$_CATEGORY_RCTBaseTextInputView_$_Markdown in RCTBaseTextInputView+Markdown.o
  _OBJC_CLASS_$_RCTUITextField, referenced from:
       in MarkdownTextInputDecoratorView.o
  _OBJC_CLASS_$_RCTUITextView, referenced from:
       in MarkdownTextInputDecoratorView.o
      l_OBJC_CLASSLIST_SUP_REFS_$_ in RCTUITextView+Markdown.o
      __OBJC_$_CATEGORY_RCTUITextView_$_Markdown in RCTUITextView+Markdown.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
  • NO_FLIPPER=1 USE_FRAMEWORKS=dynamic RCT_NEW_ARCH_ENABLED=1 pod install 🔴
ld: Undefined symbols:
  _OBJC_CLASS_$_RCTBackedTextFieldDelegateAdapter, referenced from:
      __OBJC_$_CATEGORY_RCTBackedTextFieldDelegateAdapter_$_Markdown in RCTBackedTextFieldDelegateAdapter+Markdown.o
  _OBJC_CLASS_$_RCTBaseTextInputView, referenced from:
      __OBJC_$_CATEGORY_RCTBaseTextInputView_$_Markdown in RCTBaseTextInputView+Markdown.o
  _OBJC_CLASS_$_RCTUITextField, referenced from:
       in MarkdownTextInputDecoratorView.o
  _OBJC_CLASS_$_RCTUITextView, referenced from:
       in MarkdownTextInputDecoratorView.o
      l_OBJC_CLASSLIST_SUP_REFS_$_ in RCTUITextView+Markdown.o
      __OBJC_$_CATEGORY_RCTUITextView_$_Markdown in RCTUITextView+Markdown.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@tomekzaw
Copy link
Collaborator

tomekzaw commented Apr 18, 2024

Looks like USE_FRAMEWORKS=dynamic also does not work on current main (cd42c45). Reported as #321.

Copy link
Collaborator

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! @staszekscp confirms it works for him as well.

@tomekzaw tomekzaw merged commit 0ccacf0 into Expensify:main Apr 25, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants