react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.12k stars 877 forks source link

The Swift pod `GTMAppAuth` depends upon `GTMSessionFetcher` and `AppAuth` #1263

Closed sebastian-godja closed 3 months ago

sebastian-godja commented 3 months ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @react-native-google-signin/google-signin@11.0.0 for the project I'm working on.

Expo EAS is failing the iOS builds because @react-native-google-signin/google-signin has this dependency:

which means that it will install any bigger version of "GoogleSignIn", until 8.0. "GoogleSignIn" has just released version 7.1.0 which cause this problem.

Here is the diff that solved my problem:

diff --git a/node_modules/@react-native-google-signin/google-signin/expo/ios/ExpoAdapterGoogleSignIn.podspec b/node_modules/@react-native-google-signin/google-signin/expo/ios/ExpoAdapterGoogleSignIn.podspec
index dbd46f6..38a16d9 100644
--- a/node_modules/@react-native-google-signin/google-signin/expo/ios/ExpoAdapterGoogleSignIn.podspec
+++ b/node_modules/@react-native-google-signin/google-signin/expo/ios/ExpoAdapterGoogleSignIn.podspec
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|

   s.dependency 'ExpoModulesCore'
   s.dependency 'React-Core'
-  s.dependency "GoogleSignIn", "~> 7.0"
+  s.dependency "GoogleSignIn", "~> 7.0.0"

   # Swift/Objective-C compatibility
   s.pod_target_xcconfig = {

This issue body was partially generated by patch-package.

carl0shd commented 3 months ago

+1 happens to me as well with Expo

sg3510 commented 3 months ago

+1 Happens to me too and others are experiencing this issue too - see expo discussion on Discord:

https://discord.com/channels/695411232856997968/943205994123657246/1222526739633405952

Herik22 commented 3 months ago

+1 happens to me as well with Expo, even with projects that previously worked and were only seeking to generate a new build

brentvatne commented 3 months ago

@Herik22 - see the patch-package solution in the OP for a fix.

I pinged @vonovak about this to see if he can lock the dependency version down more in the podspec.

JonathanYeeW commented 3 months ago

Hi! After this pr I updated my package.json to use "@react-native-google-signin/google-signin": "^11.0.1" and now have a different error. Does this look related to the fix that went in?

I can confirm that when I create a fresh boiler plate project and install the same version, expo run:ios works fine.

⚠️  Something went wrong running `pod install` in the `ios` directory.
Command `pod install` failed.
└─ Cause: CocoaPods could not find compatible versions for pod "ExpoAdapterGoogleSignIn":
  In Podfile:
    ExpoAdapterGoogleSignIn (from `../node_modules/@react-native-google-signin/google-signin/expo/ios`)

Specs satisfying the `ExpoAdapterGoogleSignIn (from `../node_modules/@react-native-google-signin/google-signin/expo/ios`)` dependency were found, but they required a higher minimum deployment target.

pod install --repo-update --ansi exited with non-zero code: 1
brentvatne commented 3 months ago

@JonathanYeeW - which SDK version are you using? you may need to update to use the latest version of @react-native-google-signin with the same minimum deployment target. see: https://docs.expo.dev/versions/latest/#support-for-android-and-ios-versions

JonathanYeeW commented 3 months ago

@brentvatne The expo I'm using is "expo": "~49.0.13". I'm looking at the package.json for the google-signin module and it says peer dependency is "expo": ">=47.0.0",. Am I understanding that correctly?

JonathanYeeW commented 3 months ago

Ah I see now. Yeah i got everything boosted to work on expo 50 and now we're 🚀 tyty @brentvatne

abbasmoosavi commented 3 months ago

Update to new version, current version is 11.0.1 It worked for me!

anasmohana commented 3 months ago

Hi I'm facing the same issue should I update to expo 50 to solve this issue, currently using 49.0.21

danyalg commented 2 months ago

Hi, To update packages you can use: npx npm-check-updates -u && yarn install

If you came here after updating to Expo SDK 50, you now need to install babel-plugin-module-resolver dependency manually:

npx expo install babel-plugin-module-resolver You can take a look at related expo github issue https://github.com/expo/expo/issues/25923#issuecomment-1909002141

ali-sao commented 2 months ago

Still getting this using EAS builds :

The Swift pod `GTMAppAuth` depends upon `GTMSessionFetcher`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

[!] `<PBXResourcesBuildPhase UUID=`13B.....`>` attempted to initialize an object with an unknown UUID. `526....` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.