Error after running "flutter upgrade" - dart

I am getting the following error after running flutter upgrade:
Because every version of flutter_test from sdk depends on path 1.5.1 and flutter_advanced_networkimage >=0.2.9+1 depends on path ^1.6.0, flutter_test from sdk is incompatible with flutter_advanced_networkimage >=0.2.9+1.
So, because testapp depends on both flutter_advanced_networkimage ^0.2.10 and flutter_test any from sdk, version solving failed.
pub upgrade failed (1)
My pubspec.yaml:
name: testapp
description: A new Flutter application.
dependencies:
flutter:
sdk: flutter
device_info: "^0.2.0"
shared_preferences: "^0.4.1"
flutter_parallax: "^0.1.1"
cached_network_image: "^0.4.1"
connectivity: "^0.3.1"
chewie: "^0.6.0"
flutter_statusbarcolor: "^0.0.3"
fluro: "^1.3.1"
carousel_slider: "^0.0.4"
flutter_advanced_networkimage: "^0.2.10"
flutter_sticky_header: "^0.3.0"
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
I'm trying to get it working for hours, please help

I assume you are using the beta channel.
I think this doesn't happen in dev channel.
To switch to the dev channel run in a command line shell
flutter channel dev
flutter doctor
and try again.

I've had similar problems. My problem like this:
Because every version of flutter_test from sdk depends on http 0.12.0
and flutter_cache_manager 0.1.2 depends on http ^0.11.3+14,
flutter_test from sdk is incompatible with flutter_cache_manager
0.1.2. And because no versions of flutter_cache_manager match >0.1.2 <0.2.0, flutter_test from sdk is incompatible with
flutter_cache_manager ^0.1.2.
Here's how I solved it:
dependencies:
...
dependency_overrides:
http: ^0.12.0
so, I thank you can try it:
dependencies:
...
dependency_overrides:
path: ^1.6.0

Related

Has anyone seen this compile error with stripe_payments on iOS flutter?

I am running a flutter app on iOS with stripe_payment ^0.1.0.
The demo run with only stripe_payment package builds and runs fine.
It doesn't compile when I have multiple packages in my pubspec.
Tried clearing the pub cache and run flutter packages get, tried deleting pod file and run pod install again
Error:
/Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.m:42:32: error: property 'managedAccountCurrency' not found on object of type 'STPAddSourceViewController *' cardParams.currency = self.managedAccountCurrency; ^ 6 warnings and 1 error generated. Could not build the application for the simulator. Error launching application on iPhone Xs. Exited (sigterm)
My pubspec has the following dependencies:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_local_notifications:
cupertino_icons: ^0.1.2
firebase_auth: ^0.14.0
firebase_core: ^0.4.0+8
cloud_firestore: ^0.12.9
google_sign_in: ^4.0.6
firebase_messaging: ^5.1.2
url_launcher: ^5.0.1
flutter_auth_buttons: ^0.3.1
geolocator: ^5.1.1
stripe_payment: ^0.1.0
cloud_functions: ^0.4.1
Does anyone know where this error is coming from?
I think it a conflict with one of the other packages, but not sure how to find that
I just updated the plugin to support the latest Stripe plugins on Android and iOS, which should have fixed your issue:
https://pub.dev/packages/stripe_payment/versions/0.1.1
I've changed my Podfile with:
platform :ios, '10.0'
And after flutter clean I can compile my project.

How to add a swagger dependency in pubspec.yaml of flutter

I'm a new developers with flutter, and i want to use "swagger" in my application. I add the dependencies of swagger in pubspec.yaml, but there's always an error.
pubspec.yaml:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
english_words: ^3.1.0
swagger: ^1.0.0
when i clicked Packages get, this is the following output:
Running "flutter packages get" in my_first_app...
Because my_first_app depends on swagger ^1.0.0 which doesn't match any versions, version solving failed.
pub get failed (1)
Process finished with exit code 1
How can i use swagger in my Flutter application?
You probably should use instead
open_api: ^2.0.1
swagger is deprecated and not compatible with Dart 2 and the requested version 1.0.0 doesn't exist at all.
From https://pub.dartlang.org/packages/swagger#-readme-tab-

How to fix "pub get failed(1)"

i wanted to build a Flutter App which is using firestore. I implement Firestore and when i am click on "Packages get" this error came.
The current Dart SDK version is 2.1.0-dev.9.4.flutter-f9ebf21297.
Because kegel_app requires SDK version >=1.19.0 <2.0.0-dev.infinity, version solving failed.
pub get failed (1)
How can i fix this? :/
Pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
cloud_firestore: ^0.2.6
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
kegel_app is a dependency
Because kegel_app requires SDK version >=1.19.0 <2.0.0-dev.infinity"
this tells that this package depends on a very old Flutter version that used Dart 1 or Dart 2 pre-releases.
<2.0.0- (with - after the build number) means only Dart versions that are <2.0.0 or == 2.0.0 but pre-releases.
This package is not compatible with recent Flutter versions and needs to be updated.
kegel_app is your project
Change the SDK version constraint in pubspec.yaml to
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"

flutter Got socket error trying to find package android_alarm_manager: ^0.1.0

I just tried to get package from pubspec.yaml (with flutter packages get command) in my Flutter project but it raised this error :
Got socket error trying to find package android_alarm_manager: ^0.1.0"
I'm working on my company computer (Windows 7) that is behind proxy but I absolutely have no problem for other packages (ex. font_awesome_flutter: 6.0.0).
I tried with flutter beta version.
pubspec.yaml
name: background
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.0
font_awesome_flutter: 6.0.0
android_alarm_manager: ^0.1.0
isolate: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
uses-material-design: true
remove the proxy you are using first then get the package again

flutter reference to unspecified seems stuck at 0.3.4

I'm trying to add a reference to openid_client in my flutter app.
I add a dependency to openid_client: ^0.1.3 in my pubspec.yaml and save. This runs flutter packages get, which reports the following error:
Package unscripted has no versions that match >=0.6.2 <0.7.0 derived from:
- openid_client 0.1.0 depends on version >=0.6.2 <0.7.0
Indeed, the openid_client package does depend on unscripted version 0.6.2, but my flutter app cannot reference 0.6.2. It appears the highest version of unscripted my flutter app can reference is 0.3.4. Does anyone know what I'm doing wrong?
This is my pubspec.yaml as it currently stands:
name: flit
description: A new Flutter project.
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.0
english_words: ^3.1.0
openid_client: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true

Resources