vijay
vijay

Reputation: 911

No podspec found for `google_sign_in_ios` in `.symlinks/plugins/google_sign_in_ios/darwin`

Unable to run my flutter application on iOS device (simulator) and fails with below error log, although it runs fine on Android. All was working fine until I tried to add MacOS build, which was alter rolled back but the same error persists.

I also uninstalled & reintalled cocopods, cleaned cache, flutter clean, pod install, pod [repo] update but nothing seems to work and it's always showing same error on my Mac Book pro M2 (apple chip). Anyways is runs fine on Intel chips Macbook with the same codebase, so definitely something to do with apple chip arch and/or some local cache?

Run console log output (Error):

Launching lib/main.dart on iPhone 14 Plus (6.7-inch) in debug mode...
Running pod install...
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

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

    Finding Podfile changes
      ..
      - google_mobile_ads
      - google_sign_in_ios
      ...

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `app_tracking_transparency` from `.symlinks/plugins/app_tracking_transparency/ios`
    -> Fetching podspec for `file_picker` from `.symlinks/plugins/file_picker/ios`
    -> Fetching podspec for `flutter_native_splash` from `.symlinks/plugins/flutter_native_splash/ios`
    -> Fetching podspec for `google_mobile_ads` from `.symlinks/plugins/google_mobile_ads/ios`
    -> Fetching podspec for `google_sign_in_ios` from `.symlinks/plugins/google_sign_in_ios/darwin`
    [!] No podspec found for `google_sign_in_ios` in `.symlinks/plugins/google_sign_in_ios/darwin`

    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/external_sources/path_source.rb:14:in `block in fetch'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:997:in `fetch_external_source'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:976:in `block (2 levels) in fetch_external_sources'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:975:in `each'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:975:in `block in fetch_external_sources'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:974:in `fetch_external_sources'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/installer/analyzer.rb:118:in `analyze'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:422:in `analyze'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:243:in `resolve_dependencies'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:162:in `install!'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:in `run'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in `run'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/gems/cocoapods-1.15.2/bin/pod:55:in `<top (required)>'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/bin/pod:25:in `load'
    /opt/homebrew/Cellar/cocoapods/1.15.2/libexec/bin/pod:25:in `<main>'

Error output from CocoaPods:
↳

    [!] Automatically assigning platform `iOS` with version `15.2` 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 running pod install
Error launching application on iPhone 14 Plus (6.7-inch).

My pubspec.yaml file contains:

# versions available, run `flutter pub outdated`.
version: 1.0.0+1

environment:
  sdk: '>=3.2.0 <4.0.0'

dependencies:
  flutter:
    sdk: flutter

  #...
  # other dependencies.
  #...
  googleapis: ^11.4.0
  google_sign_in: ^6.2.1
  extension_google_sign_in_as_googleapis_auth: ^2.0.11

Upvotes: 0

Views: 331

Answers (1)

vijay
vijay

Reputation: 911

Got this fixed & the issue turned out to be in .pub-cache folder.

Root Cause / Issue:

After checking out my .flutter-plugins-dependencies and .flutter-plugins files in my flutter project-root folder, learnt that the plugins are being cashed in my user home and ~/.pub-cache/hosted/pub.dev/google_sign_in_ios-5.7.4.bkp/darwin/ is empty. As below:

$ cd ~/.pub-cache/hosted/pub.dev

$ ls -l | grep 'google_sign_in_ios'
drwx------  12 vijay  staff  384 29 Oct 19:38 google_sign_in_ios-5.6.4
drwx------@ 12 vijay  staff  384  9 Apr 02:34 google_sign_in_ios-5.6.5
drwx------@ 12 vijay  staff  384  9 Apr 02:34 google_sign_in_ios-5.7.4

$ ls google_sign_in_ios-5.7.4.bkp/darwin/

Fix:

Simply renamed / deleted the google_sign_in_ios-5.7.4 as below:

$ mv google_sign_in_ios-5.7.4 google_sign_in_ios-5.7.4.bkp

After that just re-ran the flutter app, which took a minute to download something (not sure where) and App loaded successfully on to my iOS simulator.

Verified:

Just to make sure if this simple fix is really the solution (for the issue that blocked me for days and as I couldn't believe it) I did mv google_sign_in_ios-5.7.4.bkp google_sign_in_ios-5.7.4 and stopped & re-ran the app. As expected it failed with the same original error log.

Now I applied the above fix, bingo it worked. Hope it helps someone.

Upvotes: 0

Related Questions