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

GoogleSignIn SDK on Apple Silicon (M1) #7208

Closed
malcommac opened this issue Dec 22, 2020 · 82 comments
Closed

GoogleSignIn SDK on Apple Silicon (M1) #7208

malcommac opened this issue Dec 22, 2020 · 82 comments

Comments

@malcommac
Copy link

malcommac commented Dec 22, 2020

Hi, I tried to build my project on an M1 machine after updating the Firebase SDK to 7.2.0-M1. However I still get this linking error on GoogleSignIn SDK.
I'm not sure this is the right place to report it but the project itself does not have a repo and I supposed it's part of the same family.

This is the error:

ld: in .../Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(GIDEMMErrorHandler_3a47e13d8ca81b41e9cdb7ef5468004a.o), building for iOS Simulator, but linking in object file built for iOS, file '..../Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn' for architecture arm64

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@paulb777
Copy link
Member

@malcolmdeck Sorry about the trouble. GoogleSignIn has not yet added support for the simulator on ARM-based Macs.

@malcommac
Copy link
Author

thank you for your info @paulb777 . Did you have a timeline for this or some place where I can stay updated?

@paulb777
Copy link
Member

@malcommac Sorry I don't have a timeline. This has also been raised at https://developer.apple.com/forums/thread/668320. I'll leave this issue open and update when we get an update from the GoogleSignIn team.

@malcommac
Copy link
Author

Thank you I'll continue to follow this thread

@akmarinov
Copy link

akmarinov commented Jan 5, 2021

+1

The GoogleSignIn SDK hasn't seen an update in more than an year, so it's not looking good...

@malcommac
Copy link
Author

+1

The GoogleSignIn SDK hasn't seen an update in more than an year, so it's not looking good...

Did you know if there are alternatives? I would check if it’s still possible by implementing it manually.

@ericagredo
Copy link

+1
The GoogleSignIn SDK hasn't seen an update in more than an year, so it's not looking good...

Did you know if there are alternatives? I would check if it’s still possible by implementing it manually.

Yeah I would like to know if it's possible to implement manually. This issue is killer.

@ivopintodasilva
Copy link

+1

1 similar comment
@ricardomsm
Copy link

+1

@kientux
Copy link

kientux commented Jan 29, 2021

+1
The GoogleSignIn SDK hasn't seen an update in more than an year, so it's not looking good...

Did you know if there are alternatives? I would check if it’s still possible by implementing it manually.

Yes there is. Google sign in is basically using OAuth so you can manually implementing it using URLSession and/or a WKWebView.

@malcommac
Copy link
Author

+1
The GoogleSignIn SDK hasn't seen an update in more than an year, so it's not looking good...

Did you know if there are alternatives? I would check if it’s still possible by implementing it manually.

Yes there is. Google sign in is basically using OAuth so you can manually implementing it using URLSession and/or a WKWebView.

I’m not sure it’s possible anymore; google blocked login from embedded browsers in 2017; the only way is to jump in safari out of the app.
https://auth0.com/blog/google-blocks-oauth-requests-from-embedded-browsers/

@nitish-kasturia
Copy link

Workaround that I am using is running Xcode with Rosetta 2.
It's an issue with the pod running natively on Apple Silicon so for simulator and the SwiftUI canvas, it can be run through Rosetta.

@timothycosta
Copy link

The simulator runs terribly under Rosetta, at least on my machine. Google, can we please get an update for this? M1s have been out for a while now.

@malcommac
Copy link
Author

Yeah absolutely. About three months are passed and there are no news, no dates, everything is obscure.

@natanrolnik
Copy link

natanrolnik commented Feb 9, 2021

@paulb777 @petea are there any updates on this, or maybe a timeline? All our 3rd party code was updated and the only missing piece to be able to build for the iOS Simulator on M1 Macs is the Google SignIn SDK.

@kientux
Copy link

kientux commented Feb 9, 2021

While waiting for Google team to update...

If GoogleSignIn is not a critical part of your app, and you just want to run and develop other parts of the app on M1, then you can create a Xcode configuration for only M1 Mac, and don't have to run Xcode on Rosetta. The configuration can be used for exclude GoogleSignIn when build the app:

image

  • For CocoaPods install
# Include all other configurations except `Debug-M1`
pod 'GoogleSignIn', :configurations => ['Debug', 'Staging', 'Release']
  • For manual install: Untick Target membership when add GoogleSignIn.framework into project. Remove it from Link Binary with libraries build phase.

Then in Build settings, add a flag to check if current configuration is able to import GoogleSignIn:

image

(FAT_FRAMEWORK_NOT_AVAILABLE means we can't import GoogleSignIn fat framework)

Finally in code:

#if !FAT_FRAMEWORK_NOT_AVAILABLE
import GoogleSignIn
#endif

class GoogleSignInManager: NSObject {
    #if !FAT_FRAMEWORK_NOT_AVAILABLE
    private let gid: GIDSignIn = GIDSignIn.sharedInstance()
    #endif

    /// Simply do nothing on M1 Mac
    func signIn(presenter: UIViewController) {
        #if !FAT_FRAMEWORK_NOT_AVAILABLE
        self.presenter = presenter
        
        gid.delegate = self
        gid.presentingViewController = presenter
        gid.signIn()
        #endif
    }
}

Hope it helps someone! I'm currently using this method for my team to still able to developing on M1 while keep building the app for CI/CD on Intel mac mini.

@voidless
Copy link

voidless commented Feb 9, 2021

I'll leave this issue open and update when we get an update from the GoogleSignIn team.

@paulb777
Hi, I have the same issue with GoogleTagManager (and its dependencies GoogleAnalytics, GoogleUtilitiesLegacy, GoogleSymbolUtilities).
Should I create a new issue here or is this one enough for all Google pods with vendored frameworks/libs?

@paulb777
Copy link
Member

paulb777 commented Feb 9, 2021

Sorry about the lack of visibility on GoogleSignIn. There has been some progress and I'll investigate what can be shared.

@voidless GoogleTagManager is another product from another team, so another issue would be helpful.

@goudsmit
Copy link

I've solved this for now by wrapping all GIDSignIn stuff in #if !targetEnvironment(simulator) blocks, similar to the solution above by @kientux but without a symbol.

@malcommac
Copy link
Author

Any news?

@vince1393
Copy link

This is our last pod before we can get our app running on M1. We've already replaced google places because of the same issue, but unlikely we'll be able to do the same here. Hopefully this is fixed soon

@mununki
Copy link

mununki commented Jun 24, 2021

I'm afraid to say that AppAuth gives us a bit different experiences against GoogleSignIn SDK. It seems to use the webview to process the sign in with AppAuth. Instead, GoogleSignIn SDK is more like the native one. Currently GoogleSignIn is not working on simulator on Apple Silicon only, working fine on release. Changing to AppAuth means the whole different story to me.

@superman9740
Copy link

It took me less than two hours to make the switch to AppAuth, so it’s not that hard. Not being able to run on the sim is a deal breaker for a lot of folks. Are you saying you test after you release? Lol. Also, googlesignin is the only framework I use that hasn’t added SPM support. Once I left it behind, no more cocoapods.

@JohnnyTseng
Copy link

JohnnyTseng commented Jun 24, 2021

Then, of course, you won’t be able to debug using the simulator on Apple silicon. My advise: ditch this framework entirely. There are far easier routes one can take that provide the same functionality.

No, debug on Apple silicon using simulator is still possible, it's working pretty fine right now for my projects.

@BrentMifsud
Copy link

It took me less than two hours to make the switch to AppAuth, so it’s not that hard. Not being able to run on the sim is a deal breaker for a lot of folks. Are you saying you test after you release? Lol. Also, googlesignin is the only framework I use that hasn’t added SPM support. Once I left it behind, no more cocoapods.

Also google places.

It seems googles closed source frameworks are pretty much ignored. They have not been updated in ages.

@mununki
Copy link

mununki commented Jun 25, 2021

Here is my workaround for my project running on simulator.

  1. Add post install script in Podfile
# Podfile
post_install do |installer|
    # add this post install script -- start
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
    # -- end
    react_native_post_install(installer)
end
  1. pod install
$ pod install --repo-update
  1. then run the script
$ yarn ios

@dicksonconsultingllc
Copy link

Here is my workaround for my project running on simulator.

  1. Add post install script in Podfile
# Podfile
post_install do |installer|
    # add this post install script -- start
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
    # -- end
    react_native_post_install(installer)
end
  1. pod install
$ pod install --repo-update
  1. then run the script
$ yarn ios

That won't work on Apple Silicon, as the simulator is considered ARM64, as has been mentioned in other previous comments.

@dicksonconsultingllc
Copy link

Then, of course, you won’t be able to debug using the simulator on Apple silicon. My advise: ditch this framework entirely. There are far easier routes one can take that provide the same functionality.

No, debug on Apple silicon using simulator is still possible, it's working pretty fine right now for my projects.

Then there must be some detail you're leaving out, as I just tried this and it fails. Excluding Arm64 for simulator sdk ON APPLE SILICON won't link. How could it?

@elliottwilliams
Copy link

Here's another hacky workaround: you can manually edit the arm64-apple-ios GoogleSignIn binary to make it appear to be built for arm64-ios-simulator: https://bogo.wtf/arm64-to-sim.html

My team is using this to unblock ourselves, but it's obviously an unsavory workaround, and liable to break in future Xcode or macOS versions.

@JohnnyTseng
Copy link

Then, of course, you won’t be able to debug using the simulator on Apple silicon. My advise: ditch this framework entirely. There are far easier routes one can take that provide the same functionality.

No, debug on Apple silicon using simulator is still possible, it's working pretty fine right now for my projects.

Then there must be some detail you're leaving out, as I just tried this and it fails. Excluding Arm64 for simulator sdk ON APPLE SILICON won't link. How could it?

@diegostamigni Xcode will instead build x86_64 arch, and you'll have to also open the simulator in Rosetta
Maybe you can share your project settings?

@janmisar
Copy link

☹️ Sorry to say this, but AppAuth is working perfectly with Google OAuth. So instead of waiting for GoogleSignIn SDK to be updated, just switch to AppAuth and have full control over the OAuth flow.

If you are too lazy to write it, we did it for you 🤗 We have created OpenGoogleSignInSDK 🎉
It's very lightweight library written Swift, with no dependencies and it mirrors original GoogleSignInSDK API, so it's very easy to replace original SDK in your existing project.
Feel free to use, give a feedback or contribute 💪

@Ashok28
Copy link

Ashok28 commented Jun 27, 2021

☹️ Sorry to say this, but AppAuth is working perfectly with Google OAuth. So instead of waiting for GoogleSignIn SDK to be updated, just switch to AppAuth and have full control over the OAuth flow.

If you are too lazy to write it, we did it for you 🤗 We have created OpenGoogleSignInSDK 🎉
It's very lightweight library written Swift, with no dependencies and it mirrors original GoogleSignInSDK API, so it's very easy to replace original SDK in your existing project.
Feel free to use, give a feedback or contribute 💪

Great work Honza, thank you, works great 👍

@DagAgren
Copy link

DagAgren commented Jul 6, 2021

@mattdamon108 That is an unsupported hack, and it will apparently not work any longer under macOS 12.

@petea
Copy link

petea commented Jul 8, 2021

I'm happy to announce that next week we'll be making a substantive update to Google Sign-In for iOS that will provide Simulator support on M1 Macs in addition to other improvements. It's taken longer than we would have liked, but the wait is nearly over. I'll provide another update here as soon as the new release is available.

@BrentMifsud
Copy link

I'm happy to announce that next week we'll be making a substantive update to Google Sign-In for iOS that will provide Simulator support on M1 Macs in addition to other improvements. It's taken longer than we would have liked, but the wait is nearly over. I'll provide another update here as soon as the new release is available.

SPM support?

@petea
Copy link

petea commented Jul 9, 2021

SPM support?

Yes, Swift Package Manager will be supported as well.

@fassko
Copy link

fassko commented Jul 13, 2021

@petea Hi there, do you know which day could be the release?

@petea
Copy link

petea commented Jul 13, 2021

Google Sign-In iOS 6.0.0 has just been released and is now open source on GitHub!

https://github.com/google/GoogleSignIn-iOS

@paulb777
Copy link
Member

And includes M1 support! Thanks @petea!

@acecilia
Copy link

Thank you! ❤️

@paulb777 are you planning to release a prebuilt binary of Google Sign-In as part of the next firebase release?

@paulb777 paulb777 added this to the 8.4.0 - M100 milestone Jul 13, 2021
@paulb777
Copy link
Member

@acecilia Yes, the prebuilt binary is planned to be part of the 8.4.0 binary distributions cc: @ryanwilson

@wemow
Copy link

wemow commented Jul 14, 2021

@paulb777 @petea Thanks for your work! I am not sure how to use this new version tho?
I tried pod update or directly specifying the version 6.0.0 (currently 5.0.2), updating cocoapods but nothing is working, any ideas?

@petea
Copy link

petea commented Jul 14, 2021

@yemd I've responded here: google/GoogleSignIn-iOS#26

@wemow
Copy link

wemow commented Jul 14, 2021

@yemd I've responded here: google/GoogleSignIn-iOS#26

Thank you, I sent you a Podfile.lock

@Meycon
Copy link

Meycon commented Jul 15, 2021

I have the same problem with Google Sign-in for React Native version where the pod requires version 5.0 and I can't change it to 6

@paulb777
Copy link
Member

Yep - the conclusion at google/GoogleSignIn-iOS#26 is React Native support is dependent upon the resolution of react-native-google-signin/google-signin#948. Please follow along there.

@firebase firebase locked as resolved and limited conversation to collaborators Jul 15, 2021
@paulb777
Copy link
Member

Closed for comments. Please do any additional followups at https://github.com/google/GoogleSignIn-iOS

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests