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

SPM: Missing required module 'GoogleSignIn' #333

Closed
hrabkin opened this issue Aug 18, 2023 · 10 comments
Closed

SPM: Missing required module 'GoogleSignIn' #333

hrabkin opened this issue Aug 18, 2023 · 10 comments

Comments

@hrabkin
Copy link

hrabkin commented Aug 18, 2023

Describe the bug

Swift Storyboard project with linked custom framework which has GoogleSign 7.0.0 as dependency
When GoogleSignIn is linked as transitive dependency there's an error "Missing required module 'GoogleSignIn'"

To Reproduce
Steps to reproduce the behavior:

  1. Create CustomFramework Swift iOS framework project, link GoogleSign 7.0.0 as dependency using SPM (swift package manager)
  2. Create GoogleSignTest Swift project with storyboards
  3. Link CustomFramework to GoogleSignTest project
  4. Build, see error

Expected behavior
No errors

Screenshots
Screenshot 2023-08-18 at 15 35 30

Screenshot 2023-08-18 at 15 29 09

Environment

  • macOS Ventura 13.5
  • Xcode Version 14.3.1 (14E300c)
  • Google
  • Swift Storyboard project with linked custom framework which has GoogleSign 7.0.0 as dependency

Here's test project to reproduce
framework-tests.zip

@hrabkin hrabkin added bug Something isn't working triage Issues that need to be triaged labels Aug 18, 2023
@mdmathias mdmathias removed bug Something isn't working triage Issues that need to be triaged labels Aug 18, 2023
@mdmathias
Copy link
Collaborator

mdmathias commented Aug 18, 2023

Hello! Sorry you're having a problem.

I think perhaps this is a consequence of your set up and not with the library itself. I've attached a demo project that you can use as a reference. Here's what I did:

  1. Create a new framework via Xcode.
  2. Depend on GoogleSignIn-iOS in this framework.
  3. Make sure to add @import GoogleSignIn; to the framework's header. See screenshot below.
  4. Save and close that Xcode project.
  5. Create another Xcode project that is an iOS app.
  6. Add the .xcodeproj for the framework that you created in the app's project navigator.
  7. In the app's .xcodeproj file, select the "General" tab and make sure to add the framework you created and added to the project navigator. See screenshot.
  8. Make sure to import your framework where you want to use it. See the screenshot below.

Screenshot 2023-08-18 at 10 37 53 AM
image
image

FrameworkDemo.zip

@mdmathias
Copy link
Collaborator

I'm closing this for now as I think the issue is resolved. Please feel free to comment here if you're finding a bug with the GoogleSignIn-iOS. If you do, please include reproduction steps.

@hrabkin
Copy link
Author

hrabkin commented Sep 1, 2023

Thanks for your quick feedback it helped to move on but I still experience issues with GoogleSignIn.
Sorry might be a separate issue but unfortunately if I use the option I can't distribute my framework as XCFramework with GoogleSignIn dependency.

I see the following error at building
Screenshot 2023-09-01 at 18 02 20

Here's demo project with aggregate target for XCFramework and linked GoogleSignIn dependency.
FrameworkDemo 2.zip

I suppose it is something with module map exporting.

@mdmathias
Copy link
Collaborator

I don't know what you mean by the following:

Sorry might be a separate issue but unfortunately if I use the option I can't distribute my framework as XCFramework with GoogleSignIn dependency.

Sadly, I can't download your attached demo. Please list exact steps to reproduce your problem. Also, the screenshot of the error doesn't really help since I can't see the error. Please add any error you see as well.

In any case, did you reproduce the steps I listed above? It should work. I suggest you start from a clean project if you haven't already.

@hrabkin
Copy link
Author

hrabkin commented Sep 1, 2023

FrameworkDemo.2.zip

I can't build XCFramework with GoogleSignIn dependency. Including demo one more time, so that you could see the error output by your own eyes as how Xcode generates it, there's no more details about except those I have shared in the screenshot.

@mdmathias
Copy link
Collaborator

Sorry, I meant that I'm not going to download the zip. I don't mean to be rude; I just don't think it's a good practice.

In any case, please follow my suggestion in #333 (comment) and let me know what happens. If there is an issue, please provide the exact steps you took and the error you found. That will help me to reproduce and provide support.

@hrabkin
Copy link
Author

hrabkin commented Sep 1, 2023

@mdmathias oh well, its weird, why should you ask me to download your archive if its meant to be not a good practice. Anyway I have tried your approach, it works for my original sample but doesn't when I build xcframework. I hope steps of reproduction are more clear now and I have answered your question.

@mdmathias
Copy link
Collaborator

I'm sorry that it feels like a double standard; I am working with some restrictions due to my role.

I'm still not sure what error you're seeing. Also, I cannot reproduce the problem you describe. For example, in FrameworkDemo.zip above, you will see that there is a project that is just a framework: SwiftFrameworkTest. I am able to build that project. I also added a small file to SwiftFrameworkTest and added import GoogleSignIn to that file. I was able to create an instance of GIDSignIn as a property in that class and build without problem. I also was able to add a test target to the framework, and was able to create an instance of that class I made and assert that the GIDSignIn property was not nil.

I suggest that you break things down piece by piece. Build up piece-by-piece. It honestly feels like you have a problem with how your getting your dependencies.

Best of luck.

@hrabkin
Copy link
Author

hrabkin commented Sep 2, 2023

Ok, It works with simple framework, as I said that might be it should be a separate issue because it doesn't with XCFramework, full error: "failed to verify swift interface swift-interface-format-version: 1.0" pointing on GoogleSignIn at building it.

@mdmathias
Copy link
Collaborator

It looks like this might be a bug outside of GoogleSignIn: swiftlang/swift#64669. That link has some context and I think some workarounds that you might be able to try.

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