braintree / braintree_ios

Braintree SDK for iOS
https://developer.paypal.com/braintree/docs/start/hello-client/ios/v5
MIT License
560 stars 294 forks source link

Undefined symbols for architecture x86_64 - BraintreeApplePay #759

Closed JavierSilvaFreeNow closed 2 years ago

JavierSilvaFreeNow commented 2 years ago

Integration Details (please complete the following information):

Describe the bug When building the project after adding the dependency, we get this error:

Undefined symbols for architecture x86_64:
  "___llvm_profile_runtime", referenced from:
   ___llvm_profile_runtime_user in BraintreeApplePay.o
ld: symbol(s) not found for architecture x86_64

After a bit of browsing we found this Swift bug report with a similar error log, and long story short, if the Code Coverage option is turned on for the target that is adding the package, the build process will fail.

To Reproduce Steps to reproduce the behavior:

  1. Add the package to the intended target
  2. Turn Code Coverage on for said target via the Scheme Editor (Product -> Scheme -> Edit Scheme -> Select Test options -> Enable Code Coverage)
  3. Build the project

Expected behavior Project should build successfully

I'm not sure if there's anything that can be done from your side, but I figured creating the report doesn't hurt and might be beneficial for others encountering the same issue. Thank you.

scannillo commented 2 years ago

👋 Hello @JavierSilvaFreeNow - thanks for opening this GH issue. I am on Xcode 13.1 (and an Intel Mac) and I can't replicate this issue. Are you on an M1 Mac? Also - is your target written in Obj-C or Swift?

JavierSilvaFreeNow commented 2 years ago

Hi @scannillo thanks for checking on it. I'm not on an M1 Mac yet, however my target does have both Obj-C and Swift. I did some experimentation and noticed that we had linked the dependency to two targets - an internal library project and the main app; removing the dependency from one of them seems to have solved the issue.

While I have you here, I have a quick question: is the framework built with Bitcode enabled? We started getting some warnings from the CI builds after updating the library. Thanks again!

scannillo commented 2 years ago

👋 I am going to close this issue since it has resolved on your end. Regarding the Bitcode issue, please open a new GH issue, or comment in this issue if that is similar to the bitcode issue you are having.