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

DeviceKit.swiftmodule is not built for arm64 #419

Open
zakray opened this issue Sep 10, 2024 · 2 comments
Open

DeviceKit.swiftmodule is not built for arm64 #419

zakray opened this issue Sep 10, 2024 · 2 comments

Comments

@zakray
Copy link

zakray commented Sep 10, 2024

After installing DeviceKit, I'm unable to run my app via the simulator. I get "Build failed because DeviceKit.swiftmodule is not built for arm64, please try a run destination with a different architecture". After I got that error, a new simulator option with Rosetta appeared, but trying to build on that gave me a number of errors about "undefined symbol".

It does work fine on a real device.

Apologies if this is something obvious I'm missing, I don't have a lot of experience with swift packages. This is running latest macOS with Xcode 16 beta on an M2 Mac.

@wmurmann
Copy link

I've ran into this a few time while working on a silicon mac. If you're using pods one way to fix this is to add a post install script to your pod file that updates the architectures of each pod to exclude arm64 in debug mode. Not sure how to do it with swift package manager but if you move this dependency to a pod it should work fine.

  1. Close xcode
  2. Delete derived data
  3. run pod deintegrate
  4. Add this post install script to the end of your pod file
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        if config.name == 'Debug'
          config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
        end
      end
    end
  end
  1. pod install

@zakray
Copy link
Author

zakray commented Sep 15, 2024

Thanks for the suggestion, unfortunately I don't use CocoaPods

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