R.swift
R.swift copied to clipboard
Build failed for simulator on M1
Hi,
We just migrate from Cocoapod to SPM for this librairie in our projet. When we try to launch the app on a simulator, we got this error in R.generated:
Could not find module 'RswiftResources' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /[redacted]/Build/Products/Debug-iphonesimulator/RswiftResources.swiftmodule
We tried every solutions about this kind of error (e.g. changing the value of Build Active Architecture Only and Always Embed Swift Standard Libraries ).
Seems there is nothing to do on our side when the dependencies come from SPM.
Thanks in advance
I'm also seeing this issue, running on master:

I also had to fork the repo as I could never get the correct R.Swift package to return in SPM

I too am having this issue on M1 laptop. Messed with Build Active Architecture Only as well. Now im getting the error "Command PhaseScriptExecution failed with a nonzero exit code"
Same error here
Same error too
Unfortunately, I cannot reproduce this. If I create a new project with R.swift and point it at the iPhone Simulator it work.
This seems to be a generic Xcode problem. Have you tried the usual Clean build project, Delete Derived Data, reboot Mac?
If the issue still remains, can you try to create a minimal sample project that demonstrates the issue?
facing the same issue. if I open Xcode using Rosetta it builds and runs successfully on the simulator.
I just found the reason and solution for my project. I'm not sure I remember why but, when we started to have some devs with M1 and Intel in the same team, we had to exclude the arch arm64 in the project and for all dependencies in the podfile. It seems that this is not necessary anymore!
So, in the project config, I removed arm64
for Excluded Architectures
. Also, in the PodFile, I removed :
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
Did a pod install
, clean the build folder and retry!
Works on my M1 and an Intel.
@tomlokhorst this issue is fixed for me!