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

Fails to build for simulator running an Apple Silicon-based Mac #104

Open
SwiftArtery opened this issue May 31, 2022 · 2 comments
Open

Fails to build for simulator running an Apple Silicon-based Mac #104

SwiftArtery opened this issue May 31, 2022 · 2 comments

Comments

@SwiftArtery
Copy link

Installing TinyConstraints using SPM on an M1 Pro MacBook Pro, Xcode 13.4 - building for any iOS simulator will fail. It works fine on an Intel-based Mac.

Error:

Could not find module 'TinyConstraints' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /Users/will/Library/Developer/Xcode/DerivedData/<APP>/Build/Products/Debug-iphonesimulator/TinyConstraints.swiftmodule

I used to use CocoaPods and having the following in my Podfile worked for TinyConstraints and other pods:

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

I have tried modifying Universal-Target-Base.xcconfig to add

EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64

and/or removing the VALID_ARCHS settings, but to no avail.

With SPM the only fix I've found is to run Xcode in Rosetta, which really isn't ideal.

@eliburke
Copy link

I'm not currently doing ios dev (so I haven't had the fortune of running into this problem) but there's a stopgap tool called xcframework-maker that might solve your problem?

Barring that... the solution seems to be to modify the xcframework build configuration. That's beyond my ken. Googling "xcframework arm64 simulator" turned up some interesting results.

This apple thread seems especially helpful, with a solution at the bottom using xcodebuild, but I am not sure how to combine that with however TinyConstraints is configured. The xcconfig files in Configurations?

@SwiftArtery
Copy link
Author

I'm not currently doing ios dev (so I haven't had the fortune of running into this problem) but there's a stopgap tool called xcframework-maker that might solve your problem?

@eliburke Thanks for this! I'll give this a go tomorrow and see what happens. Hopefully it's enough to tide me/others over for now.

Barring that... the solution seems to be to modify the xcframework build configuration. That's beyond my ken. Googling "xcframework arm64 simulator" turned up some interesting results.

This apple thread seems especially helpful, with a solution at the bottom using xcodebuild, but I am not sure how to combine that with however TinyConstraints is configured. The xcconfig files in Configurations?

Yeah I had come across this sort of thing too - not entirely sure how to sort it. I don't have any experience with creating/updating frameworks etc, unfortunately. Ideally hoping that @roberthein or another contributor will know what is wrong and have an idea of how to fix it. I'm sure it'll be affecting everyone using TinyConstraints on an Apple Silicon machine (at least installing with SPM). Worst case is I go back to CocoaPods just for this, with the workaround in the OP, but that wouldn't be ideal really.

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