exponea / exponea-react-native-sdk

MIT License
8 stars 13 forks source link

Unable to build iOS in release mode #106

Closed LouisKraemer closed 9 months ago

LouisKraemer commented 11 months ago

Hi,

When trying to build my iOS app in release mode I get the following error in XCode.

ld: Undefined symbols:
  _swift_stdlib_isStackAllocationSafe, referenced from:
      function signature specialization <Arg[0] = [Closure Propagated : closure #1 ((key: Swift.String, value: ExponeaSDK_Notifications.JSONValue)) -> Swift.Bool in ExponeaSDK_Notifications.NotificationData.properties.getter : Swift.Dictionary<Swift.String, ExponeaSDK_Notifications.JSONValue>, Argument Types : []> of generic specialization <Swift.String, ExponeaSDK_Notifications.JSONValue> of Swift._NativeDictionary.filter(((key: A, value: B)) throws -> Swift.Bool) throws -> Swift._NativeDictionary<A, B> in ExponeaSDK_Notifications[31](NotificationData+Properties.o)

RN version 0.70.9 react-native-exponea-sdk version 1.6.0

This did not happen before adding exponea to our app.

Any way I can give more info in order to fix this?

adam1929 commented 11 months ago

Hi @LouisKraemer thank you for your reporting. Could you please check your ExponeaSDK-Notifications in Podfile/Podfile.lock? It should be same as ExponeaSDK - so 2.20.0. It seems that ExponeaSDK-Notifications version mismatched and is accessing "obsolete" code. Thank you for clarification

LouisKraemer commented 11 months ago

I have:

What versions should they be?

LouisKraemer commented 11 months ago

This is the output with both pods manually set to 2.16.4

ld: Undefined symbols:
  _swift_stdlib_isStackAllocationSafe, referenced from:
      function signature specialization <Arg[0] = [Closure Propagated : closure #1 ((key: Swift.String, value: ExponeaSDK_Notifications.JSONValue)) -> Swift.Bool in ExponeaSDK_Notifications.NotificationData.properties.getter : Swift.Dictionary<Swift.String, ExponeaSDK_Notifications.JSONValue>, Argument Types : []> of generic specialization <Swift.String, ExponeaSDK_Notifications.JSONValue> of Swift._NativeDictionary.filter(((key: A, value: B)) throws -> Swift.Bool) throws -> Swift._NativeDictionary<A, B> in ExponeaSDK_Notifications[x86_64][30](NotificationData+Properties.o)
adam1929 commented 11 months ago

Hi @LouisKraemer both ExponeaSDK and ExponeaSDK-Notifications has to be version of 2.20.0. Hard to tell, if manually set to 2.16.4 could help because of RN compilation cache BUT still it is old native iOS SDK that could not be compatible with RN SDK. It may depends on project setup, but I would try one of these steps:

  1. pod update POD_NAME - For ExponeaSDK and ExponeaSDK-Notifications. Try to not touch any other framework to avoid other problems with cache
  2. clean cache a. remote node_modules b. remove yarn/package.lock files c. remove Podfile.lock files d. clean your ~/Library/Developer/Xcode/DerivedData/* e. restart Metro with watchman watch-del-all and npm start -- --reset-cache f. I'm doing this during development phase lot of time because sometimes old swift builds are kept and makes unexpected failures

We were not facing such an issue but I think that there is some problem with old-version native framework or similar.

LouisKraemer commented 11 months ago

I understand clearing the cache but I would recommend against clearing the *.lock files. Those should not be regenerated from scratch on a existing project.

adam1929 commented 10 months ago

@LouisKraemer Hi, were you able to update iOS SDK to latest version - 2.20.0? Does it fix your build problem? Thank you

LouisKraemer commented 9 months ago

Just managed to try it, it does fix our issue yes, thanks