Search code examples
iosswiftxcodecocoapods

Setting up Google SSO with Podfile in Swift


I am trying to set up Google SSO.

My Podfile looks like this:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Recreation-iOS' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  # Pods for Google SSO
  pod 'GoogleSignIn'
  # Pods for Recreation-iOS
  target 'Recreation-iOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
  target 'Recreation-iOSUITests' do
    # Pods for testing
  end
end

Then in Terminal I ran pod install from inside the repo, but I get an error when I run it:

[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+missing+compatible+arch+in+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
 - missing compatible arch in ...
   https://github.com/CocoaPods/CocoaPods/issues/10541 [open] [3 comments]
   4 weeks ago
 - I got error when doing pod install, something to do with M1 chip
   https://github.com/CocoaPods/CocoaPods/issues/10569 [open] [2 comments]
   a week ago
 - CocoaPods compatibility with Apple DTK (Apple Silicon)
   https://github.com/CocoaPods/CocoaPods/issues/9907 [open] [105 comments]
   a day ago
and 3 more at:
https://github.com/cocoapods/cocoapods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle%2C%200x0009%29%3A%20missing%20compatible%20arch%20in%20%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle%20-%20%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle&type=Issues&utf8=✓
[!] Automatically assigning platform `iOS` with version `14.0` on target `Recreation-iOS` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`

This error message is not descriptive, so I don't know where to go from here.

--

EDIT: I tried the suggestion below and it seemed to work, but I still cannot get it to compile. Am getting this error now:

linker command failed with exit code 1 (use -v to see invocation)
----------------------------------------
SchemeBuildError: Failed to build the scheme "Recreation-iOS"
linker command failed with exit code 1 (use -v to see invocation)
Build target Recreation-iOS:
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Recreation-iOS editor. (in target 'Recreation-iOS' from project 'Recreation-iOS')
Link Recreation-iOS (arm64):
ld: warning: directory not found for option '-F/Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/AppAuth'
ld: warning: directory not found for option '-F/Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/GTMAppAuth'
ld: warning: directory not found for option '-F/Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: framework not found AppAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run custom shell script '[CP] Embed Pods Frameworks':
mkdir -p /Users/mycomputer/Library/Developer/Xcode/DerivedData/Recreation-iOS-dkyyujebjzhwjjayuxvhtjejkuie/Build/Intermediates.noindex/Previews/Recreation-iOS/Products/Debug-iphonesimulator/Recreation-iOS.app/Frameworks
/Users/mycomputer/Documents/Git/Recreation-iOS/Pods/Target Support Files/Pods-Recreation-iOS/Pods-Recreation-iOS-frameworks.sh: line 42: source: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code

Solution

  • There's a link in the 3rd line of the error message. Following it led to a page with the search string:

    dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle

    Googling "missing compatible arch" and "2.6.0" led me to this answer (https://github.com/CocoaPods/CocoaPods/issues/10220#issuecomment-730963835):

    sudo arch -x86_64 gem install ffi
    
    Then
    
    arch -x86_64 pod install