Skip to content

🐛 [cloud_firestore] Something Unexpected Occurred just after Installation #10932

Closed
@animesh27dev

Description

@animesh27dev

Bug report

Just after adding cloud_firestore in pubspec.yaml file in a fresh new flutter project, the project is getting crashed. It shows during build as below

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':cloud_firestore'.
> Could not load compiled classes for build file 'C:\Users\dex\AppData\Local\Pub\Cache\hosted\pub.dev\cloud_firestore-4.6.0\android\build.gradle' from cache.
> Failed to notify project evaluation listener.
   > Could not get unknown property 'android' for project ':cloud_firestore' of type org.gradle.api.Project.
   > Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
   > Could not get unknown property 'android' for project ':cloud_firestore' of type org.gradle.api.Project.

Steps to reproduce

Steps to reproduce the behavior:

  1. I run flutter create demo in my selected folder on Windows
  2. Entered in the folder using cd demo
  3. I Used the command flutter run and its all good, running on my physical device
  4. Now I added the package cloud_firestore using the command flutter pub add cloud_firestore
  5. Run flutter clean and then flutter pub get
  6. finally run flutter run and got the error as described above

Expected behavior

I used the cloud_firestore package before but this type of issue I never faced. The problem is that when that previous project was developed I used cloud_firestore: in the pubspec.yaml and recently I have modified some codes in my previous project. Then I tried to rebuild and I got the problem for the first time. I have checked for a fresh flutter project to understand if the problem was in my code or anything I have deleted accidentally there by mistake. But I recognize the issue is for all fresh flutter projects just after adding only the cloud_firestore package or with both firebase_core and cloud_firestore with the latest version.

Sample project

Providing a minimal example project which demonstrates the bug in isolation from your main App greatly enhances the chance of a timely fix.
Actually no need for any repository in my case.
I am explaining all the steps just above.


Additional context

No additional context yet I have to describe


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.7.12, on Microsoft Windows [Version 10.0.22621.1555], locale en-IN)
    ! Upstream repository https://github.com/flutter/flutter.git is not the same as FLUTTER_GIT_URL
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.6)
[!] Android Studio (not installed)
[√] VS Code (version 1.78.1)
[√] Connected device (4 available)
[√] HTTP Host Availability

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.19.6
Flutter SDK 3.7.12
dem2 1.0.0+1

dependencies:
- cloud_firestore 4.6.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cupertino_icons 1.0.5
- firebase_core 2.11.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine]

dev dependencies:
- flutter_lints 2.0.1 [lints]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection js matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph]

transitive dependencies:
- _flutterfire_internals 1.2.0 [collection firebase_core firebase_core_platform_interface flutter meta]
- async 2.10.0 [collection meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- characters 1.2.1
- clock 1.1.1
- cloud_firestore_platform_interface 5.13.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]  
- cloud_firestore_web 3.4.3 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js]
- collection 1.17.0
- fake_async 1.3.1 [clock collection]
- firebase_core_platform_interface 4.7.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.4.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- js 0.6.5 [meta]
- lints 2.0.1
- matcher 0.12.13 [meta stack_trace]
- material_color_utilities 0.2.0
- meta 1.8.0
- path 1.8.2
- plugin_platform_interface 2.1.4 [meta]
- sky_engine 0.0.99
- source_span 1.9.1 [collection path term_glyph]
- stack_trace 1.11.0 [path]
- stream_channel 2.1.1 [async]
- string_scanner 1.2.0 [source_span]
- term_glyph 1.2.1
- test_api 0.4.16 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]   
- vector_math 2.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions