react-native-sdk icon indicating copy to clipboard operation
react-native-sdk copied to clipboard

Undefined symbols for architecture x86_64

Open getadapt opened this issue 2 years ago • 4 comments

Hi

Thanks for the library -- we're using it in production and it's great.

We're stuck at the moment: React Native Qonversion is giving us ios build errors for x86_64 architecture when using use_frameworks! in our podfile, blocking an upgrade of React Native Firebase, one of our core dependencies.

The errors are:

Link react_native_qonversion (x86_64) 0.1 seconds

...

Undefined symbols for architecture x86_64:
  "_OBJC_METACLASS_$_RCTEventEmitter", referenced from:
      _OBJC_METACLASS_$_RNAutomations in RNAutomations.o
      _OBJC_METACLASS_$_RNQonversion in RNQonversion.o
  "_OBJC_CLASS_$_RCTEventEmitter", referenced from:
      _OBJC_CLASS_$_RNAutomations in RNAutomations.o
      _OBJC_CLASS_$_RNQonversion in RNQonversion.o
  "_RCTRegisterModule", referenced from:
      +[RNAutomations load] in RNAutomations.o
      +[RNQonversion load] in RNQonversion.o
ld: symbol(s) not found for architecture x86_64

I tried fixing by adding this to our podfile, but it didn't work:

  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('RNQonversion')
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
  end

Could you help? Or guide us to a solution / let us know how to help fix? We're keen to get this fixed soon.

I'm on: react-native-qonversion 3.5.0 react-native 0.69.5 M1 Macbook

getadapt avatar Sep 13 '22 10:09 getadapt

Hi, @getadapt Thank you for the feedback We'll try to reproduce the problem and help you ASAP.

suriksarkisyan avatar Sep 13 '22 10:09 suriksarkisyan

Hello! Could you please share your podfile with us? You can hide any third-party libraries you use if needed, but we need to see the rest of the file to be able to reproduce your case.

SpertsyanKM avatar Sep 13 '22 11:09 SpertsyanKM

Thanks - I'll get back to you on this asap, we're releasing new features so I've rolled back my dependencies until I have time to look at upgrades again

getadapt avatar Sep 15 '22 09:09 getadapt

I've fixed this by changing the react-native-qonversion podspec, after finding the below about Xcode 12 support:

https://github.com/facebook/react-native/issues/29633#issuecomment-694187116

Sorry about the duplicate issue, I got carried away with patch-package

the diff is:

diff --git a/node_modules/react-native-qonversion/react-native-qonversion.podspec b/node_modules/react-native-qonversion/react-native-qonversion.podspec
index 8f84e00..1e32170 100644
--- a/node_modules/react-native-qonversion/react-native-qonversion.podspec
+++ b/node_modules/react-native-qonversion/react-native-qonversion.podspec
@@ -21,6 +21,6 @@ Pod::Spec.new do |s|
   s.source_files = "ios/**/*.{h,m,swift}"
   s.requires_arc = true
 
-  s.dependency "React"
+  s.dependency "React-Core"
   s.dependency "QonversionSandwich", "0.2.0"
 end

wmarsey avatar Oct 04 '22 11:10 wmarsey

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 19 '22 02:10 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Oct 25 '22 02:10 github-actions[bot]