Flutterfire: [google_sign_in] iOS project combine error

Created on 6 Jan 2020  Â·  9Comments  Â·  Source: FirebaseExtended/flutterfire

I try to use google_sign_in plugin and it works well on android emulator but it throws me an error when I try with iOS.
Error shows on my console (i'm using Android Studio IDE):

In file included from /Volumes/Data/BT Flutter/44 Firebase/2 Auth & Cloud Firestore/ios/Pods/AppAuth/Source/iOS/OIDExternalUserAgentIOSCustomBrowser.m:19:
/Volumes/Data/BT Flutter/44 Firebase/2 Auth & Cloud Firestore/ios/Pods/AppAuth/Source/iOS/OIDExternalUserAgentIOSCustomBrowser.h:38:1: error: expected ','
API_UNAVAILABLE(macCatalyst)
^
In module 'Foundation' imported from /Volumes/Data/BT Flutter/44 Firebase/2 Auth & Cloud Firestore/ios/Pods/AppAuth/Source/iOS/OIDExternalUserAgentIOSCustomBrowser.h:19:
In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/os/availability.h:93:171: note: expanded from macro 'API_UNAVAILABLE'
#define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE6, __API_UNAVAILABLE5, __API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
^
1 error generated.
Runner-gqotdlqvkrdxhzfktaqntnvxhxvc
note: Using new build systemnote: Planning buildnote: Constructing build description

If I open xcode project, it show me an combine error:
'Expected ', at the statement API_UNAVAILABLE(macCatalyst)

my flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57,
locale en-VN)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] Android Studio (version 3.5)
[✓] Connected device (2 available)

• No issues found!

plugins using:

firebase_auth: 0.15.0+1
google_sign_in: 4.1.1
regression bug

All 9 comments

Hi @cuong1112035,
Using google_sign_in: 4.0.6 instead of 4.1.1 resolved my case. Try with yours, that may help.

I tried and got another error

CocoaPods' output:
↳
Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Finding Podfile changes
  R google_sign_in_web
  - Flutter
  - cloud_firestore
  - firebase_auth
  - firebase_core
  - google_sign_in

Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
-> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
-> Fetching podspec for `google_sign_in` from `.symlinks/plugins/google_sign_in/ios`

Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: Specs/0/3/5/Firebase/6.14.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: Specs/0/3/5/Firebase/6.13.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: Specs/0/3/5/Firebase/6.13.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: Specs/0/3/5/Firebase/6.13.0/Firebase.podspec.json exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: all_pods_versions_d_4_0.txt exists! Returning local because checking is only perfomed in repo update
  CDN: trunk Relative path: Specs/d/4/0/GoogleSignIn/5.0.2/GoogleSignIn.podspec.json exists! Returning local because checking is only perfomed in repo update
[!] CocoaPods could not find compatible versions for pod "GoogleSignIn":
  In snapshot (Podfile.lock):
    GoogleSignIn (= 5.0.2, ~> 5.0)

  In Podfile:
    google_sign_in (from `.symlinks/plugins/google_sign_in/ios`) was resolved to 0.0.1, which depends on
      GoogleSignIn (~> 4.0)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `GoogleSignIn` inside your development pod `google_sign_in`.
   You should run `pod update GoogleSignIn` to apply changes you've made.

/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:257:in `process_topmost_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:986:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:984:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:410:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:234:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:233:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

Error output from CocoaPods:
↳

[!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
pod repo update

I tried running pod repo update also

1/ Delete your ios/Podfile.lock file
2/ Run flutter clean
3/ Run flutter run

I also commented platform :ios, '9.0' in ios/Podfile as well

Thanks for your help, I did try and also change development target in xcode project to 9. The combine error is still there

After trying many things, google_sign_in package worked finally.
In case someone runs into my issue, you should use firebase_auth: 0.15.3+1 with google_sign_in: 4.0.6.
You also need to open your xcode project then run pod update GoogleSignIn if you get a issue in the following link: http://blog.wafrat.com/fixing-ios-compile-issues-in-flutter/
Last step, turn the build system in xcode to 'Legacy Build System'

@kroikie Why was this issue closed? The issue is present in the latest version 4.1.1. The workaround of using an older version of the package is not really a fix.

Please reopen the issue or provide an explanation for why this is not a bug and where else is the problem. Thank you.

@kaciula this seems to be an issue with the google_sign_in plugin. If so please file an issue at https://github.com/flutter/flutter/issues

After struggling a bit I found the real problem being AuthApp ( first time I see it in Podfile.lock ) being set on 1.3.0 when running Xcode 10 because it doesn't support it. After changing it to 1.2.0, my app using google_sign_in: 4.4.4 and firebase_auth: ^0.16.0 finally compiles on iPad iOS 12.2 and Chrome..

- AppAuth (1.2.0):
    - AppAuth/Core (= 1.2.0)
    - AppAuth/ExternalUserAgent (= 1.2.0)
  - AppAuth/Core (1.2.0)
  - AppAuth/ExternalUserAgent (1.2.0)

Hope it helps

Was this page helpful?
0 / 5 - 0 ratings