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

[Cloud Firestore] doesn't work with IOS (get stuck on pod install gRPC-Core) #2533

Closed
yuriGett opened this issue May 11, 2020 · 15 comments
Closed
Labels
impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) platform: ios Issues / PRs which are specifically for iOS. plugin: cloud_firestore type: bug Something isn't working

Comments

@yuriGett
Copy link

Describe the bug
The issue is that the pod install process gets stuck on Installing gRPC-Core (1.28.0)
I have tried to isolate the problem and found out that cloud_firestore: ^0.13.5 is the problem

To Reproduce
Steps to reproduce the behavior:

  1. run flutter run
  2. got stuck on Running pod install...
  3. cd ios/
  4. run pod install got stuck on Installing gRPC-Core (1.28.0)

Expected behavior
To run the project with the firebase plugin

Additional context
This the pubscpec.yaml

name: homemanagement
description: A new Flutter application.

publish_to: 'none'

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  firebase_analytics: ^5.0.2
  cloud_firestore: ^0.13.5
  firebase_storage: ^3.1.5
  firebase: ^7.3.0
  rxdart: ^0.24.0

  cupertino_icons: ^0.1.3

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

Podfile:

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  generated_key_values = {}
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) do |line|
    next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
    plugin = line.split(pattern=separator)
    if plugin.length == 2
      podname = plugin[0].strip()
      path = plugin[1].strip()
      podpath = File.expand_path("#{path}", file_abs_path)
      generated_key_values[podname] = podpath
    else
      puts "Invalid plugin specification: #{line}"
    end
  end
  generated_key_values
end

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  # Flutter Pod

  copied_flutter_dir = File.join(__dir__, 'Flutter')
  copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
  copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
  unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
    # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
    # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
    # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.

    generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
    unless File.exist?(generated_xcode_build_settings_path)
      raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
    end
    generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
    cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];

    unless File.exist?(copied_framework_path)
      FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
    end
    unless File.exist?(copied_podspec_path)
      FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
    end
  end

  # Keep pod path relative so it can be checked into Podfile.lock.
  pod 'Flutter', :path => 'Flutter'

  # Plugin Pods

  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.each do |name, path|
    symlink = File.join('.symlinks', 'plugins', name)
    File.symlink(path, symlink)
    pod name, :path => File.join(symlink, 'ios')
  end
end

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Flutter doctor
Run flutter doctor and paste the output below:

[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.4 19E266, locale en-IL)
    • Flutter version 1.17.0 at /Users/yuri.abramov/Flutter/flutter
    • Framework revision e6b34c2b5c (9 days ago), 2020-05-02 11:39:18 -0700
    • Engine revision 540786dd51
    • Dart version 2.8.1

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/yuri.abramov/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Users/yuri.abramov/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/192.6392135/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4.1, Build version 11E503a
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.6)
    • Android Studio at /Users/yuri.abramov/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/192.6392135/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.1.1)
    • IntelliJ at /Users/yuri.abramov/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 44.0.3
    • Dart plugin version 193.6911.31

[✓] Connected device (1 available)
    • iPhone 11 Pro Max • 192CA87B-1416-449E-9569-91BC1FB0325F • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-4 (simulator)

• No issues found!
Process finished with exit code 0

Already tried:
flutter pub cache repair and pod install
pod update Firebase/Firestore

@TahaTesser
Copy link

TahaTesser commented May 13, 2020

Hi @yuriGett
Not able to reproduce this issue on pod version 1.9.1
Can you please try same packages in a new project?
Thank you

@TahaTesser TahaTesser added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label May 13, 2020
@yuriGett
Copy link
Author

Hi @TahaTesser just tried on a new project and facing the same issue..

@TahaTesser TahaTesser added platform: ios Issues / PRs which are specifically for iOS. plugin: cloud_firestore type: bug Something isn't working and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 15, 2020
@greenblue467
Copy link

same here, any solution?

@devr-tech
Copy link

any solutions?

@greenblue467
Copy link

After couple hours of pod installation, it finally worked. I guess we have to be very very patient...

@yuriGett
Copy link
Author

My solution was to download the Pod gRPC-Core from another project on Github and manually to add it to my Pods directory and then to run pod upgrade and pod install in ios directory

@TahaTesser TahaTesser added the impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) label May 19, 2020
@KrystofM
Copy link

KrystofM commented May 24, 2020

the cloning of the repositories when installing gRCP-Core seems to be endless but when running the Pod install verbose it is actually getting somewhere. This really is dependency hell.

Cloning into '/private/var/folders/0g/_zjqscqx6cl5ggymnnstyhkh0000gn/T/d20200524-50567-g2gos8/third_party/abseil-cpp'... Cloning into '/private/var/folders/0g/_zjqscqx6cl5ggymnnstyhkh0000gn/T/d20200524-50567-g2gos8/third_party/benchmark'... Cloning into '/private/var/folders/0g/_zjqscqx6cl5ggymnnstyhkh0000gn/T/d20200524-50567-g2gos8/third_party/bloaty'... Cloning into '/private/var/folders/0g/_zjqscqx6cl5ggymnnstyhkh0000gn/T/d20200524-50567-g2gos8/third_party/boringssl-with-bazel'... Cloning into '/private/var/folders/0g/_zjqscqx6cl5ggymnnstyhkh0000gn/T/d20200524-50567-g2gos8/third_party/cares/cares'... Cloning into '/private/var/folders/0g/_zjqscqx6cl5ggymnnstyhkh0000gn/T/d20200524-50567-g2gos8/third_party/envoy-api'... Cloning into '/private/var/folders/0g/_zjqscqx6cl5ggymnnstyhkh0000gn/T/d20200524-50567-g2gos8/third_party/gflags'... Cloning into '/private/var/folders/0g/_zjqscqx6cl5ggymnnstyhkh0000gn/T/d20200524-50567-g2gos8/third_party/googleapis'... Cloning into '/private/var/folders/0g/_zjqscqx6cl5ggymnnstyhkh0000gn/T/d20200524-50567-g2gos8/third_party/googletest'... Cloning into '/private/var/folders/0g/_zjqscqx6cl5ggymnnstyhkh0000gn/T/d20200524-50567-g2gos8/third_party/libuv'...

@KrystofM
Copy link

Okay got it to work by downgrading to an older version and now being able to build. But I am getting build times like 210.6s or 218.6s! This is seriously very bad.

@iTatla1
Copy link

iTatla1 commented May 31, 2020

Facing same issue. @KrystofM which version did you use.

@emran92
Copy link

emran92 commented Jun 3, 2020

I was having the same issue on a new project. But after getting stuck on gRPC-Core install I waited around 5-10 minutes and then it proceed with pod install. Probably it's a server issue.

@iTatla1
Copy link

iTatla1 commented Jun 3, 2020

I've waited and still am waiting it's been more than half an hour its still stuck on Run POD
Screenshot 2020-06-03 at 9 22 33 PM

@iTatla1
Copy link

iTatla1 commented Jun 3, 2020

IT WORKED LOL. BUT IT ONLY TOOK 69.7 MINUTES :D

Imagine 1hr and 9 minutes for a single POD install. They need to fix it!!

@danahartweg
Copy link

I had a similar issue where pod install would fail on gRPC-C++ because it couldn't include openssl. Adding the below to the Podfile to manually lock the version of BoringSSL_GRPC seemed to fix things up for me for the time being. Having other issues building right now, so if it turns out everything crashes and burns when running in-app, I'll amend this.

# lock the version of `BoringSSL-GRPC` so installing gRPC-C++ via cloud_firestore doesn't fail
pod 'BoringSSL-GRPC', '0.0.3'

This issue led me in the right direction: grpc/grpc#16821

@hashanspc
Copy link

hashanspc commented Jun 16, 2020

I had the same issue and this article helped.
Also be patient in the pod install as it could take like 15mins or more sometimes when you come across this issue.

https://medium.com/@phongyewtong/how-to-fix-flutter-stuck-at-running-pod-install-when-run-578ad867774

@Salakar
Copy link
Member

Salakar commented Jul 8, 2020

Hey all, as part of our on-going work for #2582, the project structure/setup for iOS & MacOS in our Firebase Firestore rework (#2913) has been improved which should help with this along with using the new pre-compiled Firestore binaries to improve build times.

The rework has now been merged into master. We'll look at publishing some prereleases in the next few days. Thank you

@Salakar Salakar closed this as completed Jul 8, 2020
@firebase firebase locked and limited conversation to collaborators Aug 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) platform: ios Issues / PRs which are specifically for iOS. plugin: cloud_firestore type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants