Xcode Does Not Found Symbols For A… | Apple Developer Forums

  • Apple Developer
  • Apple Developer
Forums Search for a topic, subtopic, or tag Clear search query Local Nav Open Menu Local Nav Close Menu
  • Search
Post Profile
  • Sign in
  • Create account
Xcode does not found symbols for architecture x86_64 using XCFrameworks Developer Tools & Services Xcode Xcode You’re now watching this thread. If you’ve opted in to email or web notifications, you’ll be notified when there’s activity. Click again to stop watching or visit your profile to manage watched threads and notifications. You’ve stopped watching this thread and will no longer receive emails or web notifications when there’s activity. Click again to start watching. LFuryk OP Created Feb ’20 Replies 3 Boosts 0 Views 12k Participants 3

Xcode (11.3.1) is having issues to found x86_64 architecture symbols while using XCFrameworks. The problem is that the architecture is inside the XCFramework, but first let me show you how the framework was created.

To generate the XCFramework I made two Archives:

  1. For iOS:xcodebuild archive -scheme MyPod -target MyPod -destination="iOS" -archivePath build/ios.xcarchive -derivedDataPath /tmp/iphoneos -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
  2. For iOS Simulator:xcodebuild archive -scheme MyPod -target MyPod -destination="iOS Simulator" -archivePath build/iossimulator.xcarchive -derivedDataPath /tmp/iphoneos -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES

Then I generated the XCFramework:

xcodebuild -create-xcframework -framework ./build/ios.xcarchive/Products/Library/Frameworks/MyPod.framework -framework ./build/iossimulator.xcarchive/Products/Library/Frameworks/MyPod.framework -output xcframework/MyPod.xcframework

Here is the XCFramework created where we can see the two architectures: XCFramework preview

Once it was created, I distributed it by Cocoapods (1.9.0.beta.3). So my .podspec looks like:

s.subspec "Vendored" do |framework| framework.vendored_framework = 'xcframework/MyPod.xcframework' end

Then I consumed it in another project, and when compiling, it fails because it can't find the architecture for the simulator (on devices it works)

The log I got is the following:

ld: warning: ignoring file /Path/To/MyProject/Pods/MyPod/xcframework/MyPod.xcframework/ios-armv7_arm64/MyPod.framework/MyPod, missing required architecture x86_64 in file /Path/To/MyProject/Pods/MyPod/xcframework/MyPod.xcframework/ios-armv7_arm64/MyPod.framework/MyPod (2 slices) Undefined symbols for architecture x86_64: "_OBJC_CLASS_$MyPod", referenced from: objc-class-ref in SomeClass.o ld: symbol(s) not found for architecture x86_64

It looks like xcodebuild always go to the

ios-armv7_arm64 folder instead the ios-i386_x86_64-simulator one, any ideas?

Thank you!

Answered by DTS Engineer in 405839022

The destination arguments should be -destination "generic/platform=iOS" and -destination "generic/platform=iOS Simulator". Here is the documentation with this info. Also, test integrating the XCFramework into another project without involving CocoaPods to determine if they are contributing to this issue.

Boost Copy to clipboard Share this post Copied to Clipboard Replies 3 Boosts 0 Views 12k Participants 3 DTS Engineer OP Apple Feb ’20 Accepted Answer

The destination arguments should be -destination "generic/platform=iOS" and -destination "generic/platform=iOS Simulator". Here is the documentation with this info. Also, test integrating the XCFramework into another project without involving CocoaPods to determine if they are contributing to this issue.

0 comments 1 Copy to clipboard Share this post Copied to Clipboard Load more Add comment LFuryk OP Feb ’20

Thank you for the answer!

I tried again without using Cocoapods y it works!

0 comments 0 Copy to clipboard Share this post Copied to Clipboard Load more Add comment Onkar OP Dec ’20 I am facing similar issue with XCode 12.2 for my custom framework. I tried by specifying -destination. Still result is same.Generated XCFramework don't have x86_64 architecture symbols. 0 comments 1 Copy to clipboard Share this post Copied to Clipboard Load more Add comment Xcode does not found symbols for architecture x86_64 using XCFrameworks First post date Last post date Q

Tag » Architecture X86_64