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

RswiftResources no such module error #805

Open
alessiolapenna opened this issue Feb 9, 2023 · 11 comments
Open

RswiftResources no such module error #805

alessiolapenna opened this issue Feb 9, 2023 · 11 comments

Comments

@alessiolapenna
Copy link

I'm trying to migrate R.swift to the latest version using the plugin import method.
On local workstations it works fine. Even the archive is completed correctly.
But when i run this in the Github action that we use for CI it can never complete an archive.
The r.generated file is correctly written, but when compiled it cannot find the RswiftResources module, causing the compilation process to fail.

Screenshot 2023-02-09 alle 09 01 03

Screenshot 2023-02-09 alle 09 01 40

I tried using a project or switching to a workspace.
Tried messing with various build settings, but nothing seems to work.

From what I can see the plugin is configured correctly as it has no problem locally in debug or archive.
Maybe there is some "fixed" path that is necessary and when running in CI there is some problem with the location where this library is created and located?

@Zeropointer11
Copy link

Zeropointer11 commented Feb 13, 2023

I have the same issue hope there is a solution soon.
as a side node the issue is also when you run the xcodebuild command locally

xcodebuild -workspace ./MyApp.xcworkspace -scheme MyApp -sdk 'iphoneos16.2' -destination 'generic/platform=iOS' -archivePath MyApp.xcarchive -skipPackagePluginValidation clean archive

@jujuforce
Copy link

Got the same issue, please help.

@AndreiAvram123
Copy link

AndreiAvram123 commented Feb 14, 2023

I got this issue as well on my local machine

@zvonedev
Copy link

I have the same problems for last two days, did anyone managed to fix it or is there a planned fix by the package owners itself?

@Zeropointer11
Copy link

i figured out it happens when you build the executableTarget() for the plugin when you remove the build plugin the archive is working. I think thats the case because the Plugin is Compiled for macOS to execute and the archive is a build for iOS.

A possible workaround would be to include the executable target prebuild in the Package.swift
SwiftLint had the same problem and they fixed it with that approach.

 .binaryTarget(
            name: "SwiftLintBinary",
            url: "https://github.com/realm/SwiftLint/releases/download/0.50.3/SwiftLintBinary-macos.artifactbundle.zip",
            checksum: "abe7c0bb505d26c232b565c3b1b4a01a8d1a38d86846e788c4d02f0b1042a904"
        )

@tomlokhorst
Copy link
Collaborator

Removing the -sdk 'iphoneos16.2' option from xcodebuild should fix the issue.
The app will still be build for iOS because of the specified destination.

We could indeed think about shipping a prebuilt binary, if only to avoid this scenario, because multiple people have already run into this.

@alessiolapenna
Copy link
Author

I think that shipping a prebuild binary is the solution to go IMHO. SwiftLint solved the same issue in the same way and it works well indeed.

@garethlloyd1994
Copy link

garethlloyd1994 commented Jun 28, 2023

Is there any update for a solution for this? Or is there a workaround?

This is currently blocking us from using Firebase Test Labs with our CI as this requires code to be built using xcodebuild with the SDK set to -sdk iphoneos.

@alessiolapenna
Copy link
Author

In my case the xcode build command doesn't contain the -sdk parameter so the workaround doesn't work for me.
Is there any way we can have this fixed in the future?

My command is this:
xcodebuild -resolvePackageDependencies -scheme Prod -project App.xcodeproj -configuration ProdRelease

@tomlokhorst
Copy link
Collaborator

A workaround is to not use the build plugin, but instead run the command plugin manually.

@alessiolapenna
Copy link
Author

alessiolapenna commented Jul 11, 2023 via email

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

7 participants