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

Support for Project Catalyst #2840

Closed
Gerzer opened this issue Jun 13, 2019 · 3 comments
Closed

Support for Project Catalyst #2840

Gerzer opened this issue Jun 13, 2019 · 3 comments
Assignees
Labels

Comments

@Gerzer
Copy link

Gerzer commented Jun 13, 2019

I'm trying to build an app that depends on Alamofire v5.0.0-beta6 using Project Catalyst (i.e., UIKit for Mac) with Xcode 11.0 beta 1 on macOS 10.15 Catalina developer beta 1. Building for iOS works perfectly, but when I set the scheme to that for my Mac, the build fails, and I get the following error:

ignoring file /Users/[...]/Library/Developer/Xcode/DerivedData/[...]/Build/Products/Debug-uikitformac/Alamofire.o, building for iOS-arm64 but attempting to link with file built for UIKitForMac-x86_64

Is there anything that I can do on my end to fix this, or do I have to wait for a change to the library itself to support Project Catalyst?

@jshier
Copy link
Contributor

jshier commented Jun 14, 2019

This depends on how you're integrating Alamofire into your project. If you're using Swift Package Manager in Xcode 11, just point at the 5.0.0-beta.6 version and you should be good to go. I was able to integrate a test project automatically. If you're using CocoaPods, they need to add explicit support for the platform, which they're discussing in this issue. If you use Carthage, they're discussing support in this issue. If you're importing the source manually, I don't think you'll need to do anything. If you're using a precompiled framework, you'll need to recompile and produce an xcframework that includes all of your require platforms.

@jshier jshier self-assigned this Jun 14, 2019
@jshier jshier added the support label Jun 14, 2019
@Gerzer
Copy link
Author

Gerzer commented Jun 14, 2019

Thanks for the quick response! I'm using the Swift Package Manager functionality in Xcode 11, but I'm still getting the same error. Following the above message, I'm also seeing dozens of variations of the following, one for each use of a symbol that should be defined by the Alamofire library:

Undefined symbols for architecture arm64:
    "static Alamofire.JSONParameterEncoder.default.getter : Alamofire.JSONParameterEncoder", referenced from:
        closure #1 (__C.UIAlertAction) -> () in [My_App]_Intents_Extension.ViewController.actionButtonTapped(__C.UIBarButtonItem) -> () in ViewController.o
        [...]

@Gerzer
Copy link
Author

Gerzer commented Jun 14, 2019

Actually, I just fixed the issue myself! It turns out that my iOS-specific app extensions (e.g., my Siri Intents extension, which is unsupported on the Mac), which also depend on Alamofire, were listed as dependencies on both iOS and macOS for the main app. As such, Xcode was trying to compile Alamofire as if it were to be run on an arm64 device. Setting those extensions to be dependencies on iOS only fixed the problem that I was having. Thanks for the help!

@Gerzer Gerzer closed this as completed Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants