英文:
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: '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 base on some propositions from other stackoverflow contributors. Thanks
答案1
得分: 0
库的名称是firebase_core,而不是firebasecore。
只需在pubspec.yaml中进行更改。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论