google / GoogleSignIn-iOS

Enables iOS and macOS apps to sign in with Google.
https://developers.google.com/identity/sign-in/ios
Apache License 2.0
472 stars 189 forks source link

Swift package broken for v7.0.0 #365

Closed trzy closed 6 months ago

trzy commented 6 months ago

Describe the bug Added the GoogleSignIn package via the built-in Swift package manager in Xcode 15.2. It appears to be present but cannot "import GoogleSignIn" -- no such module exists.

To Reproduce Create an Xcode project. Under "Packages", search and add GoogleSignIn. Try to "import GoogleSignIn"

Expected behavior I expect the import to succeed and be able to build my project.

Screenshots If applicable, add screenshots to help explain your problem.

Environment N/A

Additional context Add any other context about the problem here.

yalkhder commented 6 months ago

Couldn't reproduce issue. I was able to successfully add GoogleSignIn to a project.

Reproduction steps:

  1. Created new iOS app Xcode project
  2. Went to File -> Add Package Dependencies...
  3. Entered googlesignin-ios git URL (https://github.com/google/GoogleSignIn-iOS.git) in the search bar in the top right corner
  4. Clicked Add Package
trzy commented 6 months ago

Did you try to import and build? Because it is clearly not working with new projects here.

On Feb 9, 2024, at 11:06 AM, Yasser Al-Khder @.***> wrote:

Closed #365 https://github.com/google/GoogleSignIn-iOS/issues/365 as not planned.

— Reply to this email directly, view it on GitHub https://github.com/google/GoogleSignIn-iOS/issues/365#event-11761532483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJZ3RJ4T5X3XIW63QECZC3YSZXTFAVCNFSM6AAAAABC4XKSFCVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRG43DCNJTGI2DQMY. You are receiving this because you authored the thread.

yalkhder commented 6 months ago

Yes I imported GoogleSignIn and called GIDSignIn.sharedInstance.

trzy commented 6 months ago

So why does this fail consistently on a clean install of Xcode on my Ventura Mac? This is extremely frustrating and as a result, we are considering abandoning Google social sign in altogether for our product. It looks to me like sub-dependencies are failing to import, namely the Firebase one.

On Feb 9, 2024, at 11:17 AM, Yasser Al-Khder @.***> wrote:

Yes I imported GoogleSignIn and called GIDSignIn.sharedInstance.

— Reply to this email directly, view it on GitHub https://github.com/google/GoogleSignIn-iOS/issues/365#issuecomment-1936472189, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJZ3RKW6NGDGVF5LOEVNETYSZY57AVCNFSM6AAAAABC4XKSFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZWGQ3TEMJYHE. You are receiving this because you authored the thread.

yalkhder commented 6 months ago

Can you share some more info? Namely:

Thanks

trzy commented 6 months ago

Yes, sure, I’ve uploaded the project here, which should have everything needed to see the issue happening: https://github.com/trzy/GoogleSignIn-Test

In GoogleSignInTestApp.swift, you can see the import fail. There is no stack trace, just the singular error message in Xcode.

Thank you,

Bart

On Feb 9, 2024, at 2:17 PM, Yasser Al-Khder @.***> wrote:

Can you share some more info? Namely:

Repo/Package.swift file/podspec file Stack trace and/or error messages you're seeing Any other relevant screenshot, resources, etc... Thanks

— Reply to this email directly, view it on GitHub https://github.com/google/GoogleSignIn-iOS/issues/365#issuecomment-1936677149, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJZ3RNPSX36CJMCSSD3UWLYS2OAFAVCNFSM6AAAAABC4XKSFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZWGY3TOMJUHE. You are receiving this because you authored the thread.

yalkhder commented 6 months ago

Xcode doesn't make it super obvious, but the dependency to GoogleSignIn is not being added to the target (see pbxproj file). Can you re-add the GoogleSignIn package dependency and make sure under "Add to Target" the GoogleSignInTest target is selected?

trzy commented 6 months ago

Thank you! That was exactly it. I would have never noticed it — strangely, my other packages didn’t require me explicitly specifying the target. Might be worth making a note of this and adding a screenshot here: https://developers.google.com/identity/sign-in/ios/start-integrating#swift-package-manager

On Feb 13, 2024, at 10:20 AM, Yasser Al-Khder @.***> wrote:

Xcode doesn't make it super obvious, but the dependency to GoogleSignIn is not being added to the target (see pbxproj file https://github.com/trzy/GoogleSignIn-Test/blob/b9e20f69bf9d114b59df23ae0a94945473ce1951/GoogleSignInTest/GoogleSignInTest.xcodeproj/project.pbxproj#L143). Can you re-add the GoogleSignIn package dependency and make sure under "Add to Target" the GoogleSignInTest target is selected?

— Reply to this email directly, view it on GitHub https://github.com/google/GoogleSignIn-iOS/issues/365#issuecomment-1942139750, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJZ3RJP6GOTHZDGHY4H2LLYTOVFXAVCNFSM6AAAAABC4XKSFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGEZTSNZVGA. You are receiving this because you authored the thread.