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] Something Unexpected Occurred just after Installation #10932

Closed
animesh27dev opened this issue May 10, 2023 · 6 comments
Closed
Labels
closed-by-bot resolution: no-response Customer did not respond after some time. Stale Issue with no recent activity type: bug Something isn't working

Comments

@animesh27dev
Copy link

animesh27dev commented May 10, 2023

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

@animesh27dev animesh27dev added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels May 10, 2023
@darshankawar darshankawar added the triage Issue is currently being triaged. label May 10, 2023
@darshankawar
Copy link

@animesh27dev
Can you provide details of the gradle version you are using in your project as well as in the new one ?
Looks like the error indicates the plugin may not be compatible with the gradle version being used.

AGP 8.0 support was recently merged #10825, so can you switch to latest master and run your scenario again to see if you still get same error or not ?

@darshankawar darshankawar added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 10, 2023
@animesh27dev
Copy link
Author

In my project: classpath 'com.android.tools.build:gradle:7.2.0'

Current Gradle version installed is

------------------------------------------------------------
Gradle 8.1.1
------------------------------------------------------------

Build time:   2023-04-21 12:31:26 UTC
Revision:     1cf537a851c635c364a4214885f8b9798051175b

Kotlin:       1.8.10
Groovy:       3.0.15
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          11.0.12 (Microsoft 11.0.12+7)
OS:           Windows 10 10.0 amd64

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 10, 2023
@animesh27dev
Copy link
Author

I have temporarily fixed it by mentioning the previous versions

dependencies:
  firebase_core: ^1.20.0
  cloud_firestore: ^3.4.5
  firebase_auth: ^3.5.0

and a dependency_overrides

dependency_overrides:
  firebase_core_platform_interface: ^4.5.1

But I want to know why this happens with the latest versions:

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 the cache.

@darshankawar
Copy link

But I want to know why this happens with the latest versions:

Since the error is pointing to cache folder, try clearing it using cd android && .\gradlew clean build or %USERPROFILE%\.gradle\caches and see if it helps.

@darshankawar darshankawar added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 11, 2023
@google-oss-bot google-oss-bot added the Stale Issue with no recent activity label Jun 1, 2023
@google-oss-bot
Copy link

Hey @animesh27dev. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link

Since there haven't been any recent updates here, I am going to close this issue.

@animesh27dev if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@darshankawar darshankawar added resolution: no-response Customer did not respond after some time. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. triage Issue is currently being triaged. labels Jun 12, 2023
@firebase firebase locked and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closed-by-bot resolution: no-response Customer did not respond after some time. Stale Issue with no recent activity type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants