RevenueCat / purchases-kmp

RevenueCat SDK for Kotlin Multiplatform
MIT License
99 stars 3 forks source link

Undefined symbols for architecture arm64 #259

Closed marenovakovic closed 4 days ago

marenovakovic commented 2 weeks ago

Describe the bug I followed KMP setup and everything works fine on Android. On iOS I used SPM, not cocoapods. When I want to run iOS app I get:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_RCCustomerInfo", referenced from:
       in shared[2865](libcom.revenuecat.purchases:revenuecatui-cache.a.o)
  "_OBJC_CLASS_$_RCEntitlementInfo", referenced from:
       in shared[2805](libcom.revenuecat.purchases:mappings-cache.a.o)
  "_OBJC_CLASS_$_RCPackage", referenced from:
       in shared[2805](libcom.revenuecat.purchases:mappings-cache.a.o)
  "_OBJC_CLASS_$_RCPaywallFooterViewController", referenced from:
       in shared[2865](libcom.revenuecat.purchases:revenuecatui-cache.a.o)
  "_OBJC_CLASS_$_RCPaywallViewController", referenced from:
       in shared[2865](libcom.revenuecat.purchases:revenuecatui-cache.a.o)
  "_OBJC_CLASS_$_RCStoreProductDiscount", referenced from:
       in shared[2805](libcom.revenuecat.purchases:mappings-cache.a.o)
  "_OBJC_CLASS_$_RCStoreTransaction", referenced from:
       in shared[2865](libcom.revenuecat.purchases:revenuecatui-cache.a.o)
ld: symbol(s) not found for architecture arm64

I've found similar issue linked to ReactNative but nothing there helped me resolve the issue.

  1. Environment
    1. Platform: KMP iOS
    2. SDK version: 1.3.0+13.7.0
    3. OS version: any
    4. IDE (e.g. Android Studio, Xcode, Fleet): Android Studio, Xcode
marenovakovic commented 4 days ago

Resolved. For some season Link Binary With Libraries build phase was missing. Once I added PurchasesHybridCommon and PurchasesHubridCommonUI (those two are imported view SwiftPackageManager) to Link Binary With Libraries it worked fine.

JayShortway commented 1 day ago

Thanks for reporting back with details on how it was resolved! I have never seen that build phase being missing, but good to know that it's a possibility.