'Can't resolve flutter_tts and firebase_auth
I'm new to Flutter and I'm trying to use flutter_tts in my project but a pub get isn't resolving it. I had been using this API in other applications but I can't use it there as well anymore. Others packages are fine and it's like this just with flutter_tts and firebase_auth. Any help would be appreciated.
pubspec:
name: aa
description: aa
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.16.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
flutter_tts: ^3.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter:
uses-material-design: true
pub get output:
Running "flutter pub get" in aa...
Because flutter_tts >=0.8.0 depends on flutter_web_plugins from sdk which is forbidden, flutter_tts >=0.8.0 is forbidden.
So, because aa depends on flutter_tts ^3.0.0, version solving failed.
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Because flutter_tts >=0.8.0 depends on flutter_web_plugins from sdk which is forbidden, flutter_tts >=0.8.0 is forbidden.
So, because aa depends on flutter_tts ^3.0.0, version solving failed.
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
And it goes on and on
Solution 1:[1]
Sometimes it may be because of a particular dependency you just add in your pubspec.yaml.
Try to remove the recent dependency you just add, and save it. If there error doesn't occur. Then
You just need to add the dependency without version like: flutter_tts: instead of flutter_tts: ^3.0.0 or else you can change your flutter channel to fix this issue
flutter channel dev
flutter doctor -v
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Himanshu Maurya |
