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

Symbols not found issue on M1 mac with objective-c pod #66

Open
tejassharma96 opened this issue Mar 26, 2022 · 4 comments
Open

Symbols not found issue on M1 mac with objective-c pod #66

tejassharma96 opened this issue Mar 26, 2022 · 4 comments

Comments

@tejassharma96
Copy link

tejassharma96 commented Mar 26, 2022

Hi! I'm trying to test out cocoapods-bazel to integrate pods into a project. It seems to work fine for swift pods, but it spits out ld: symbol(s) not found for architecture arm64 when I try to install SDWebImage. I tried to use another Pod that is pure swift and it seemed to work fine there. I couldn't find a pod with mixed sources to test, so not sure how it would work there.

Here is a project for repro: https://github.com/tejassharma96/basic-bazel-app
Repro steps (on m1, not sure if this issue exists on intel macs):

  • bundle install
  • bundle exec pod install
  • bazelisk build //:ios-app

Would appreciate any help here and info on what I might be doing wrong here. Thanks!

@tejassharma96
Copy link
Author

Actually tried it out with zxcvbn-ios, which is also objective-c, and that worked.

Based on that, I tried removing "WebImage/SDWebImage.h" from public_headers in the BUILD.bazel for SDWebImage, which didn't work and gave me the same error. I tried doing the opposite, ie removing everything except "WebImage/SDWebImage.h" from public_headers. This didn't give me the symbols not found error, but instead failed because it couldn't find a header :/

@lumpidu
Copy link

lumpidu commented May 31, 2024

A bit late to the game, but I tried out your repo, which showed a linking problem, because you were missing to add the Accelerate Apple framework as a dependency for SDWebImage.

So simply add the followoing lines to your apple_framework and ios_application targets:

sdk_frameworks = ["Accelerate"]

@tejassharma96
Copy link
Author

tejassharma96 commented Jun 3, 2024

ah interesting @lumpidu, thank you for the info! how did you figure out that Accelerate was missing? is that called out anywhere in the logs or did you need to investigate SDWebImage to see which frameworks it depends on?

@lumpidu
Copy link

lumpidu commented Jun 5, 2024

I googled the unreferenced symbols it spat out. And there came up some threads where Accelerate was mentioned. That did the trick.

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

No branches or pull requests

2 participants