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

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

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

问题

I have this project which works fine when I had not added [chatview: ^1.2.0+1][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


[1]: https://pub.dev/packages/chatview

<details>
<summary>英文:</summary>

I have this project which works fine when I had not added [chatview: ^1.2.0+1][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&#39;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



  [1]: https://pub.dev/packages/chatview

</details>


# 答案1
**得分**: 14

最近有一个更新,扩大了Flutter SDK本地化的依赖版本,要求>=0.17.0但<0.19.0。

所以我只是覆盖了我的依赖以使用0.18.0:
```yaml
dependency_overrides:
  intl: ^0.18.0
英文:

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:

dependency_overrides:
  intl: ^0.18.0

答案2

得分: 1

问题在于flutter_localizations目前依赖于intl 0.17.0。所以您现在唯一的选择是将chatview降级到使用intl 0.17.0的版本。

看起来flutter_localizations正在更新以使用intl 0.18.0,但这个更新还没有进入稳定的Flutter渠道。
详情请参见:https://github.com/flutter/flutter/issues/117163

英文:

The problem is that flutter_localizations currently depends on intl 0.17.0. So the only option you have, at this time, is to downgrade chatview to a version that uses intl 0.17.0.

It looks like flutter_localizations is being updated to use intl 0.18.0 but this hasn't hit the stable flutter channel yet.
See: https://github.com/flutter/flutter/issues/117163

答案3

得分: 0

覆盖 pubspec.yaml 文件中的依赖项,按照以下方式进行:

dependency_overrides:
  intl: ^0.18.0
英文:

Overrides dependency in pubspec.yaml file by following

dependency_overrides:
intl: ^0.18.0

huangapple
  • 本文由 发表于 2023年2月26日 19:54:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75571793.html
匿名

发表评论

匿名网友

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

确定