My flutter app failed to run and says it lucks the firebase_core dependency but it exists in pubspec.yaml. How can I solve the problem

huangapple go评论115阅读模式
英文:

My flutter app failed to run and says it lucks the firebase_core dependency but it exists in pubspec.yaml. How can I solve the problem

问题

I am working on a flutter notebook app from a freecodecamp tutorial. The instructor of the course asked us to install firebase_core, firebase_analytics, firebase_auth, and cloud_firestore which I did, and I was able to run the app successfully. Everything was going well until I configured my firebase backend. I had the firebase_CLI installed and the flutterfire_CLI also. I was also able to interact with my firebase account from the firebase_CLI and connected my app to a firebase_project. However, when I tried to run the app again, it threw a statement "Because notebook depends on firebasecore any which doesn't exist (could not find package firebasecore at https://pub.dev), version solving failed." and yet I have the firebase_core plugin. App name is notebook.

I have tried updating the flutter sdk using flutter upgrade, run the flutter clean command to clean the project. Running flutter pub actually resorts to the same error hence hindering from running. I expect the app to run so that I continue with development but that one statement prevents. I am using windows 10 pro version 22H2(OS Build 19045.2965).

Here is my pubspec.yaml:

name: notebook
description: A new Flutter project.
publish_to: 'none'
version: 1.0.0+1
environment:
  sdk: '>=2.19.5 <3.0.0'
dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2
  firebasecore: any
  firebase_auth: any
  cloud_firestore: ^4.7.0
  firebase_analytics: ^10.4.0
dev_dependencies:
  flutter_test:
    sdk: flutter

In addition, I changed the version of my firebase_core and firebase_auth from 2.13.1 to any and 4.16.2 to any respectively based on some propositions from other stackoverflow contributors. Thanks.

英文:

I am working on a flutter notebook app from a freecodecamp tutorial. The instructor of the course asked us to install firebase_core,firebase_analytics,firebase_auth and cloud_firestore which I did and I was able to run the app successfully.Everything was going well until I configured my firebase backend. I had the firebase_CLI installed and the flutterfire_CLI also. I was also able to interact with my firebase account from the firebase_CLI and connected my app to a firebase_project. However when I tried to run the app again, it threw a statement "Because notebook depends on firebasecore any which doesn't exist (could not find package firebasecore at https://pub.dev),
version solving failed."
and yet I have the firebase_core plugin. App name is notebook

I have tried updating the flutter sdk using flutter upgrade, run the flutter clean command to clean the project.Running flutter pub actually resorts to the same error hence hindering from running. I expect the app to run so that I continue with development but that one statement prevents. I am using** windows 10 pro version 22H2(OS Build 19045.2965)**
**`
The pubspec.yaml image

 Here is my pubspec.yaml

       name: notebook
    description: A new Flutter project.
    
    publish_to: &#39;none&#39; 
    
    version: 1.0.0+1
    
    environment:
      sdk: &#39;&gt;=2.19.5 &lt;3.0.0&#39;
    dependencies:
      flutter:
        sdk: flutter
      cupertino_icons: ^1.0.2
      firebasecore: any
      firebase_auth: any
      cloud_firestore: ^4.7.0
      firebase_analytics: ^10.4.0
    
    dev_dependencies:
      flutter_test:
        sdk: flutter

In addition I changed the version of my firebase_core and firebase_auth from 2.13.1 to any and 4.16.2 to any respectively base on some propositions from other stackoverflow contributors. Thanks

答案1

得分: 0

库的名称是firebase_core,而不是firebasecore。

只需在pubspec.yaml中进行更改。

英文:

The library name is firebase_core not firebasecore.

Just change in pubspec.yaml

huangapple
  • 本文由 发表于 2023年6月6日 17:23:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/76413188.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定