I have this project which works fine when I had not added chatview: ^1.2.0+1. Now after adding it as a dependency, I get an error of
Because chatview >=1.0.0 depends on intl ^0.18.0 and mobile_app depends on intl ^0.17.0, chatview >=1.0.0 is forbidden.
So, because mobile_app depends on chatview ^1.2.0+1, version solving failed.
pub get failed
command: "/Users/samuel/flutter/bin/cache/dart-sdk/bin/dart __deprecated_pub --directory . get --example"
pub env: {
"FLUTTER_ROOT": "/Users/samuel/flutter",
"PUB_ENVIRONMENT": "vscode.dart-code:flutter_cli:get",
"PUB_CACHE": "/Users/samuel/.pub-cache",
}
exit code: 1
Now i changed the version of my intl
package to intl ^0.18.0
which I expected to work fine but I also got another error of
Because mobile_app depends on flutter_localizations from sdk which depends on intl 0.17.0, intl 0.17.0 is required.
So, because mobile_app depends on intl ^0.18.0, version solving failed.
pub get failed
command: "/Users/samuel/flutter/bin/cache/dart-sdk/bin/dart __deprecated_pub --directory . get --example"
pub env: {
"FLUTTER_ROOT": "/Users/samuel/flutter",
"PUB_ENVIRONMENT": "vscode.dart-code:flutter_cli:get",
"PUB_CACHE": "/Users/samuel/.pub-cache",
}
exit code: 1
Now I don’t know what to do again. Below is my pubspec.yaml file
environment:
sdk: ">=2.18.4 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
get: ^4.6.5
flutter_svg_provider: ^1.0.3
shared_preferences: ^2.0.10
http: ^0.13.5
image_picker: ^0.8.5+3
flutter_localizations:
sdk: flutter
intl: ^0.18.0
logger: ^1.1.0
pretty_http_logger: ^0.2.1
font_awesome_flutter: ^9.2.0
package_info_plus: ^3.0.0
flutter_screenutil: ^5.5.4
another_flushbar: ^1.12.29
flutter_fadein:
avatar_glow: ^2.0.2
dropdown_search: ^5.0.5
expandable_text: ^2.3.0
infinite_scroll_pagination: ^3.2.0
cached_network_image: ^3.2.3
chatview: ^1.2.0+1
[✓] Flutter (Channel stable, 3.7.1, on macOS 13.0.1 22A400 darwin-x64, locale en-GH)
Checking Android licenses is taking an unexpectedly long time...[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.75.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
2
Answers
So there was a recent update to widen the dependency version of the localisation of flutter sdk to >=0.17.0 <0.19.0
So I just overided my dependency to use 0.18.0 by:
The problem is that
flutter_localizations
currently depends onintl 0.17.0
. So the only option you have, at this time, is to downgradechatview
to a version that usesintl 0.17.0
.It looks like
flutter_localizations
is being updated to useintl 0.18.0
but this hasn’t hit the stable flutter channel yet.See: https://github.com/flutter/flutter/issues/117163