How to fix cloud firestore package not installing in flutter project? - firebase

Adding firebase cloud firestore to my project dependency packages crashes my apps. I first observed the problem when I was coding along with a youtube tutorial. Now even creating a new flutter project and adding the cloud firestore dependency package then trying to build the app won't work. How to I fix this problem?
Example below is for the app built by flutter on creating a new project with the addition of a cloud firestore dependency package. Any help is appreciated.
Pubspec.yaml
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
cloud_firestore: ^0.13.7
dev_dependencies:
flutter_test:
sdk: flutter
added cloud_firestore: ^0.13.7 to dependencies.
Debug console log
Running pod install... 478.2s (!)
CocoaPods' output:
↳
Invalid plugin specification: DART_DEFINES=flutter.inspector.structuredErrors=true
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
-> Fetching podspec for `cloud_firestore_web` from `.symlinks/plugins/cloud_firestore_web/ios`
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
-> Fetching podspec for `firebase_core_web` from `.symlinks/plugins/firebase_core_web/ios`
Resolving dependencies of `Podfile`
Comparing resolved specification to the sandbox manifest
A BoringSSL-GRPC
A Firebase
A FirebaseAnalytics
A FirebaseCore
A FirebaseCoreDiagnostics
A FirebaseFirestore
A FirebaseInstallations
A Flutter
A GoogleAppMeasurement
A GoogleDataTransport
A GoogleUtilities
A PromisesObjC
A abseil
A cloud_firestore
A cloud_firestore_web
A firebase_core
A firebase_core_web
A gRPC-C++
A gRPC-Core
A leveldb-library
A nanopb
Downloading dependencies
[!] Error installing gRPC-Core
[!] /usr/local/bin/git -C /var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v submodule update --init --recursive
Submodule path 'third_party/abseil-cpp': checked out 'b832dce8489ef7b6231384909fd9b68d5a5ff2b7'
Submodule path 'third_party/benchmark': checked out '090faecb454fbd6e6e17a75ef8146acb037118d4'
Submodule path 'third_party/bloaty': checked out '73594cde8c9a52a102c4341c244c833aa61b9c06'
Submodule path 'third_party/boringssl-with-bazel': checked out '1c2769383f027befac5b75b6cedd25daf3bf4dcf'
Submodule path 'third_party/cares/cares': checked out 'e982924acee7f7313b4baa4ee5ec000c5e373c30'
Submodule path 'third_party/envoy-api': checked out '0487bbb43c3e8b54c7332f74ba7344d8265774f7'
Submodule path 'third_party/gflags': checked out '28f50e0fed19872e0fd50dd23ce2ee8cd759338e'
Submodule path 'third_party/gflags/doc': checked out '8411df715cf522606e3b1aca386ddfc0b63d34b4'
Submodule path 'third_party/googleapis': checked out '80ed4d0bbf65d57cc267dfc63bd2584557f11f9b'
Submodule path 'third_party/googletest': checked out 'c9ccac7cb7345901884aabf5d1a786cfa6e2f397'
Submodule path 'third_party/libuv': checked out '15ae750151ac9341e5945eb38f8982d59fb99201'
Submodule path 'third_party/protobuf': checked out 'fe1790ca0df67173702f70d5646b82f48f412b99'
Submodule path 'third_party/protobuf/third_party/benchmark': checked out '5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8'
Submodule path 'third_party/protobuf/third_party/googletest': checked out '5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081'
Submodule path 'third_party/protoc-gen-validate': checked out 'c0a080f4bea50bc087cdd8551143ee538cf3459e'
Submodule path 'third_party/udpa': checked out 'db4b343e48c1264bb4d9ff491b059300701dc7c7'
Submodule path 'third_party/zlib': checked out 'cacf7f1d4e3d44d871b605da3b647f07d718623f'
Submodule 'third_party/abseil-cpp' (https://github.com/abseil/abseil-cpp.git) registered for path 'third_party/abseil-cpp'
Submodule 'third_party/benchmark' (https://github.com/google/benchmark) registered for path 'third_party/benchmark'
Submodule 'third_party/bloaty' (https://github.com/google/bloaty.git) registered for path 'third_party/bloaty'
Submodule 'third_party/boringssl-with-bazel' (https://github.com/google/boringssl.git) registered for path 'third_party/boringssl-with-bazel'
Submodule 'third_party/cares/cares' (https://github.com/c-ares/c-ares.git) registered for path 'third_party/cares/cares'
Submodule 'third_party/envoy-api' (https://github.com/envoyproxy/data-plane-api.git) registered for path 'third_party/envoy-api'
Submodule 'third_party/gflags' (https://github.com/gflags/gflags.git) registered for path 'third_party/gflags'
Submodule 'third_party/googleapis' (https://github.com/googleapis/googleapis.git) registered for path 'third_party/googleapis'
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/googletest'
Submodule 'third_party/libuv' (https://github.com/libuv/libuv.git) registered for path 'third_party/libuv'
Submodule 'third_party/protobuf' (https://github.com/google/protobuf.git) registered for path 'third_party/protobuf'
Submodule 'third_party/protoc-gen-validate' (https://github.com/envoyproxy/protoc-gen-validate.git) registered for path 'third_party/protoc-gen-validate'
Submodule 'third_party/udpa' (https://github.com/cncf/udpa.git) registered for path 'third_party/udpa'
Submodule 'third_party/zlib' (https://github.com/madler/zlib) registered for path 'third_party/zlib'
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/abseil-cpp'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/benchmark'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/boringssl-with-bazel'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/cares/cares'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/envoy-api'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/gflags'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/googleapis'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/googletest'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/libuv'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/protobuf'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/protoc-gen-validate'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/udpa'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/zlib'...
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/bloaty/third_party/googletest'
Submodule 'third_party/libFuzzer' (https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer) registered for path 'third_party/bloaty/third_party/libFuzzer'
Submodule 'third_party/re2' (https://github.com/google/re2) registered for path 'third_party/bloaty/third_party/re2'
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/googletest'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/libFuzzer'...
fatal: unable to access 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer/': Failed to connect to chromium.googlesource.com port 443: Operation timed out
fatal: clone of 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer' into submodule path '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/libFuzzer' failed
Failed to clone 'third_party/libFuzzer'. Retry scheduled
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/re2'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/libFuzzer'...
fatal: unable to access 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer/': Failed to connect to chromium.googlesource.com port 443: Operation timed out
fatal: clone of 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer' into submodule path '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/libFuzzer' failed
Failed to clone 'third_party/libFuzzer' a second time, aborting
Submodule 'doc' (https://github.com/gflags/gflags.git) registered for path 'third_party/gflags/doc'
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/gflags/doc'...
Submodule 'third_party/benchmark' (https://github.com/google/benchmark.git) registered for path 'third_party/protobuf/third_party/benchmark'
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/protobuf/third_party/googletest'
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/protobuf/third_party/benchmark'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/protobuf/third_party/googletest'...
Failed to recurse into submodule path 'third_party/bloaty'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader.rb:142:in `rescue in execute_command'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader.rb:139:in `execute_command'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-downloader-1.4.0/lib/cocoapods-downloader/base.rb:166:in `block in executable'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-downloader-1.4.0/lib/cocoapods-downloader/git.rb:153:in `target_git'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-downloader-1.4.0/lib/cocoapods-downloader/git.rb:114:in `update_submodules'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-downloader-1.4.0/lib/cocoapods-downloader/git.rb:101:in `block in clone'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader.rb:173:in `block in ui_sub_action'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader.rb:172:in `ui_sub_action'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-downloader-1.4.0/lib/cocoapods-downloader/git.rb:98:in `clone'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-downloader-1.4.0/lib/cocoapods-downloader/git.rb:66:in `download!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-downloader-1.4.0/lib/cocoapods-downloader/base.rb:82:in `block in download'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader.rb:157:in `block in ui_action'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader.rb:156:in `ui_action'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-downloader-1.4.0/lib/cocoapods-downloader/base.rb:80:in `download'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader.rb:108:in `download_source'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader.rb:75:in `download_request'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader/cache.rb:171:in `download'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader/cache.rb:154:in `block in uncached_pod'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader/cache.rb:181:in `in_tmpdir'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader/cache.rb:153:in `uncached_pod'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/downloader.rb:42:in `download'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/installer/pod_source_installer.rb:118:in `download_source'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/installer/pod_source_installer.rb:69:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/installer.rb:561:in `install_source_of_pod'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/installer.rb:512:in `block (2 levels) in install_pod_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/user_interface.rb:86:in `titled_section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/installer.rb:511:in `block in install_pod_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/installer.rb:494:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/installer.rb:494:in `install_pod_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/installer.rb:253:in `block in download_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/installer.rb:252:in `download_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/lib/cocoapods/installer.rb:161:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/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.10.0.beta.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0.beta.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
Error output from CocoaPods:
↳
Cloning into '/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v'...
Note: checking out 'e122aae3cecae0e6be11b62fbe81eda55e662a02'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
Submodule 'third_party/re2' (https://github.com/google/re2) registered for path 'third_party/bloaty/third_party/re2'
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/googletest'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/libFuzzer'...
fatal: unable to access 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer/': Failed to connect to chromium.googlesource.com port 443: Operation timed out
fatal: clone of 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer' into submodule path '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/libFuzzer' failed
Failed to clone 'third_party/libFuzzer'. Retry scheduled
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/re2'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/libFuzzer'...
fatal: unable to access 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer/': Failed to connect to chromium.googlesource.com port 443: Operation timed out
fatal: clone of 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer' into submodule path '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/libFuzzer' failed
Failed to clone 'third_party/libFuzzer' a second time, aborting
Submodule 'doc' (https://github.com/gflags/gflags.git) registered for path 'third_party/gflags/doc'
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/gflags/doc'...
Submodule 'third_party/benchmark' (https://github.com/google/benchmark.git) registered for path 'third_party/protobuf/third_party/benchmark'
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/protobuf/third_party/googletest'
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/protobuf/third_party/benchmark'...
Cloning into '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/protobuf/third_party/googletest'...
Failed to recurse into submodule path 'third_party/bloaty'
[!] 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 running pod install
Error launching application on iPhone 11 Pro.
Exited (sigterm)
flutter doctor -v results
[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.4 19E287, locale en-ZM)
• Flutter version 1.17.5 at /Users/Silokas_Mac/Developer/flutter
• Framework revision 8af6b2f038 (4 weeks ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/Silokas_Mac/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode-beta.app/Contents/Developer
• Xcode 11.6, Build version 11N700h
• CocoaPods version 1.10.0.beta.1
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (2 available)
• sdk gphone x86 • emulator-5554 • android-x86 • Android
10 (API 29) (emulator)
• iPhone 11 Pro • 659FF369-2ED5-4E0D-B5F8-3D19BE86B98F • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
• No issues found! ```
**Pod file**
# 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
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENA`enter code here`BLE_BITCODE'] = 'NO'
end
end
end

To use any of the flutterfire plugins it's necessary to include firebase_core as well.
Add
firebase_core: ^0.4.5
to your dependencies. Or find the most recent version on pub.dev.

environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cloud_firestore: ^0.13.7 // move to here
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
OR
Try installing Pubspec Assist plugin in your editor for not getting any error.

I ran into this issue today and worked around it by downgrading git from a 2.31.1 variation to version 2.30.1 (Apple Git-130). See the output of git --version.
For a simple reproducible example of the underlying git issue: git clone --verbose https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer
In the log above see
fatal: unable to access 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer/': Failed to connect to chromium.googlesource.com port 443: Operation timed out
fatal: clone of 'https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer' into submodule path '/private/var/folders/wc/4m_4_wzs56v5z7g3z35vylxw0000gn/T/d20200725-9607-d8qy8v/third_party/bloaty/third_party/libFuzzer' failed
Failed to clone 'third_party/libFuzzer'. Retry scheduled
UPDATE: The 2.31.1 git version now works after the owners of https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer ran git gc

Related

I'm getting error during flutter run. Error has something to pod file. Does anyone know how to resolve?

I did pod repo update. It's not working. I am running on Mac. I tried reinstalling cocapods but It didn't help either. How to do I resolve this? Really been stuck on this for a day now. This is the error its giving :
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
pod repo update
Error running pod install
Error launching application on iPhone 13.
Launching lib/main.dart on iPhone 13 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
- Flutter
- cloud_firestore
- firebase_auth
- firebase_core
- firebase_dynamic_links
- firebase_storage
- geolocator_apple
- google_sign_in
- image_cropper
- image_picker
- path_provider_ios
- qr_code_scanner
- share_plus
- sqflite
- url_launcher_ios
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
cloud_firestore: Using Firebase SDK version '8.9.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
firebase_auth: Using Firebase SDK version '8.9.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
firebase_core: Using Firebase SDK version '8.9.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_dynamic_links` from `.symlinks/plugins/firebase_dynamic_links/ios`
firebase_dynamic_links: Using Firebase SDK version '8.9.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_storage` from `.symlinks/plugins/firebase_storage/ios`
firebase_storage: Using Firebase SDK version '8.9.0' defined in 'firebase_core'
-> Fetching podspec for `geolocator_apple` from `.symlinks/plugins/geolocator_apple/ios`
-> Fetching podspec for `google_sign_in` from `.symlinks/plugins/google_sign_in/ios`
-> Fetching podspec for `image_cropper` from `.symlinks/plugins/image_cropper/ios`
-> Fetching podspec for `image_picker` from `.symlinks/plugins/image_picker/ios`
-> Fetching podspec for `path_provider_ios` from `.symlinks/plugins/path_provider_ios/ios`
-> Fetching podspec for `qr_code_scanner` from `.symlinks/plugins/qr_code_scanner/ios`
-> Fetching podspec for `share_plus` from `.symlinks/plugins/share_plus/ios`
-> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
-> Fetching podspec for `url_launcher_ios` from `.symlinks/plugins/url_launcher_ios/ios`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/3/5/Firebase/8.10.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_d_4_0.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/d/4/0/GoogleSignIn/6.1.0/GoogleSignIn.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_3_7_4.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/3/7/4/TOCropViewController/2.6.0/TOCropViewController.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_0_2_a.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.11/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_f_4_e.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/f/4/e/FMDB/2.7.5/FMDB.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/3/5/Firebase/8.9.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In snapshot (Podfile.lock):
Firebase/CoreOnly (= 8.7.0)
In Podfile:
firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 1.10.6, which depends on
Firebase/CoreOnly (= 8.9.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 `Firebase/CoreOnly` inside your development pod `firebase_core`.
You should run `pod update Firebase/CoreOnly` to apply changes you've made.
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `tap'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:257:in `process_topmost_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/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.11.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
pod repo update
Error running pod install
Error launching application on iPhone 13.
Well, basically your CocoaPods setup is going to break. You are going to have to manually delete any local copies of the Specs repository and re-clone the new version of the Specs repository. You can do that with the following below commands:
After a lot of solution applying, I found a way that has been successful in solving this error, it goes something like this
It can be solved by executing the following commands in the terminal.
Go to /ios folder inside your Project.
Delete Podfile.lock (YourPoject/ios/Podfile.lock)
For Intel chipusers
Run pod install --repo-update (Make sure your cd into the iOS directory of the flutter app)
For M1 chip Users
install ffi first (if not) In regular terminal using command: sudo arch -x86_64 gem install ffi then arch -x86_64 pod install --repo-update
Run flutter clean
Once complete, rebuild your Flutter application: flutter run

Geofire cocoapods error running pod install

Once i add flutter geofire to my project it wouldn't run, for some reasons.
I have tried alot of stuffs the one that happens to work is:
pod init ,
pod install
this works but then after my google maps stops working and flutter for some reasons cannot import googlemaps in the AppDelegate file.
Here is the error :
Launching lib/main.dart on iPhone 12 Pro Max 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`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `connectivity` from `.symlinks/plugins/connectivity/ios`
-> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
firebase_auth: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_database` from `.symlinks/plugins/firebase_database/ios`
firebase_database: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
-> Fetching podspec for `flutter_geofire` from `.symlinks/plugins/flutter_geofire/ios`
-> Fetching podspec for `geolocator` from `.symlinks/plugins/geolocator/ios`
-> Fetching podspec for `google_maps_flutter` from `.symlinks/plugins/google_maps_flutter/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_a_d_d.txt exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: Specs/a/d/d/GoogleMaps/4.2.0/GoogleMaps.podspec.json exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: all_pods_versions_c_7_9.txt exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: Specs/c/7/9/Reachability/3.2/Reachability.podspec.json exists! Returning local because checking is only perfomed in repo update
[!] CocoaPods could not find compatible versions for pod "firebase_auth":
In Podfile:
firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
Specs satisfying the `firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)` dependency were found, but they required a higher minimum deployment target.
/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:684:in `attempt_to_activate'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254: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.10.1/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/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.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/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 `9.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 running pod install
Error launching application on iPhone 12 Pro Max.
I have done some research and I deleted my pod lock folder and also tried updating my cocoa pods by opening it in my terminal and running pod install --repo-update,
But it wouldn't still update and shows this error below:
user#users-MacBook-Pro ios % pod install --repo-update
Updating local specs repositories
Analyzing dependencies
firebase_auth: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_database: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "firebase_auth":
In Podfile:
firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
Specs satisfying the `firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)` dependency were found, but they required a higher minimum deployment target.
[!] Automatically assigning platform `iOS` with version `9.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`.
user#users-MacBook-Pro ios %
here is my pubspec.yaml:
name: padi_driver
description: A new Flutter application.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
firebase_core: ^1.0.1
firebase_auth: ^1.0.1
firebase_database: ^6.1.0
connectivity: ^3.0.3
google_maps_flutter: ^2.0.1
outline_material_icons: ^0.1.1
geolocator: ^7.0.1
http: ^0.13.1
provider: ^5.0.0
flutter_polyline_points: ^0.2.6
font_awesome_flutter: ^9.0.0
animated_text_kit: ^4.0.0
# flutter_geofire: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
assets:
- images/
fonts:
- family: Brand-Bold
fonts:
- asset: fonts/bolt-semibold.ttf
- family: Brand-Regular
fonts:
- asset: fonts/bolt-regular.ttf
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
Yeah pls i need assistance i have spent a lot of time on this.
Thanks in advance :]

Pods unable to update or install - Dart/Flutter

I want to implement firebase and for that I have to update the pods. However, when I type pod repo update in the console, it just does nothing... it just shows my "Updating spec repo 'trunk'" and then it shows my prompt. And if I type pod install into the console it shows:
[!] Invalid `Podfile` file: /Users/tlobry/Desktop/Flutter/Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first.
# from /Users/tlobry/Desktop/Podfile:16
# -------------------------------------------
# unless File.exist?(generated_xcode_build_settings_path)
> raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
# end
# -------------------------------------------
this is my pubspec.yaml:
name: flash_chat
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.1.0<3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
animated_text_kit: ^4.1.1
firebase_core: ^1.0.3
firebase_auth: ^1.0.2
cloud_firestore: ^1.0.4
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- images/
and this is my 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 flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
This is what I've tried in the past to fix Pod install issues:
Remove podfile.lock from the ios folder
rm Podfile.lock
Run pod install again
You may also try changing your Podfile to
platform :ios, '10.0'

How to fix Firebase Analytics Plugin install error

I am trying to install firebase analytics plugin in my ionic project using
sudo ionic cordova plugin add cordova-plugin-firebase-analytics
But i get this as my error and the plugin isnt installed. I have tried pod install and pod update but it still gives the same error
> cordova plugin add cordova-plugin-firebase-analytics
Installing "cordova-plugin-firebase-analytics" for ios
Failed to install 'cordova-plugin-firebase-analytics': undefined
CordovaError: Promise rejected with non-error: '/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18/rbconfig.rb:215: warning: Insecure world writable dir /Users/villifixinc/Documents/TravelApp in PATH, mode 040777\n/Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:439:in `help!\': \u001b[31m[!] You cannot run CocoaPods as root.\u001b[39m (CLAide::Help)\n\n\u001b[4mUsage:\u001b[24m\n\n $ \u001b[32mpod\u001b[39m \u001b[32mCOMMAND\u001b[39m\n\n CocoaPods, the Cocoa library package manager.\n\n\u001b[4mCommands:\u001b[24m\n\n \u001b[32m+ cache\u001b[39m Manipulate the CocoaPods cache\n \u001b[32m+ env\u001b[39m Display pod environment\n \u001b[32m+ init\u001b[39m Generate a Podfile for the current directory\n \u001b[32m+ install\u001b[39m Install project dependencies according to versions from a\n Podfile.lock\n \u001b[32m+ ipc\u001b[39m Inter-process communication\n \u001b[32m+ lib\u001b[39m Develop pods\n \u001b[32m+ list\u001b[39m List pods\n \u001b[32m+ outdated\u001b[39m Show outdated project dependencies\n \u001b[32m+ repo\u001b[39m Manage spec-repositories\n \u001b[32m+ setup\u001b[39m Setup the CocoaPods environment\n \u001b[32m+ spec\u001b[39m Manage pod specs\n \u001b[32m+ update\u001b[39m Update outdated project dependencies and create new Podfile.lock\n\n\u001b[4mOptions:\u001b[24m\n\n \u001b[34m--silent\u001b[39m Show nothing\n \u001b[34m--version\u001b[39m Show the version of the tool\n \u001b[34m--verbose\u001b[39m Show more debugging information\n \u001b[34m--no-ansi\u001b[39m Show output without ANSI codes\n \u001b[34m--help\u001b[39m Show help banner of specified command\n\tfrom /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:47:in `run\'\n\tfrom /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>\'\n\tfrom /usr/local/bin/pod:22:in `load\'\n\tfrom /usr/local/bin/pod:22:in `<main>\'\n'
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:29:15)
at process._tickCallback (internal/process/next_tick.js:68:7)
[ERROR] An error occurred while running subprocess cordova.
cordova plugin add cordova-plugin-firebase-analytics exited with exit
code 1.
Re-running this command with the --verbose flag may provide more
information.
try installing the older version of the plugin. version 2.0.3 should fix your problem.

Adding Firestore dependency causes error in Flutter app

Adding cloud_firestore: ^0.12.10 dependency in my flutter project gives errors.
These are the dependencies my project has:
dependencies:
url_launcher: ^5.0.0
flutter_launcher_icons: ^0.7.4
cloud_firestore: ^0.12.10
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
firebase_messaging: ^5.1.6
dev_dependencies:
flutter_test:
sdk: flutter
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/launcher_icon/LauncherIcon.png"
I tried to use different cloud_firestore versions, but none of them worked.
This is the output of flutter run command in the terminal:
Launching lib\main.dart on SM A505F in debug mode...
Initializing gradle... 1.1s
Resolving dependencies... 16.3s
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
FAILURE: Build failed with an exception.
* What went wrong:
Failed to notify dependency resolution listener.
> The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.2.1,17.2.1]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
> The library com.google.firebase:firebase-iid is being requested by various other libraries at [[20.0.0,20.0.0]], but resolves to 17.1.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 11.8s
Gradle task assembleDebug failed with exit code 1
This is the output of flutter doctor -v:
[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18362.418], locale en-IN)
• Flutter version 1.9.1+hotfix.6 at D:\flutter_windows_v1.9.1+hotfix.2-stable\flutter
• Framework revision 68587a0916 (8 weeks ago), 2019-09-13 19:46:58 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\aditl\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 41.0.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.40.0)
• VS Code at C:\Users\aditl\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.6.0
[√] Connected device (1 available)
• SM A505F • RZ8M60LFVPP • android-arm64 • Android 9 (API 28)
! Doctor found issues in 1 category.
from you log errors
* What went wrong:
Failed to notify dependency resolution listener.
> The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.2.1,17.2.1]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
> The library com.google.firebase:firebase-iid is being requested by various other libraries at [[20.0.0,20.0.0]], but resolves to 17.1.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
you need to update firebase core to 17.2.1 if you have added it to your gradle files,
Although this is an issue with your project not being androidX enabled
see how to migrate to androidX
update
Cannot fit requested classes in a single dex file (# methods: 81876 > 65536)
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
you need to enable multidex for your application
as follows
android {
defaultConfig {
...
minSdkVersion 16
targetSdkVersion 28
multiDexEnabled true
}
...
}
dependencies {
implementation "androidx.multidex:multidex:2.0.0"
}
Add this line of code in your android/build.gradle file in the bottom. I think you missed the step of adding the services plugin.
Try this
and put cloud_firestore: ^0.12.10 dependency below firebase_messaging dependency.
Code:
apply plugin: 'com.google.gms.google-services'
Add this line inside your target 'Runner' do block in your Podfile, e.g.:
# ...
target 'Runner' do
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.9.0'
# ...
end

Resources