【问题标题】:how do i solve this error am trying to add my flutter app to web我如何解决这个错误我试图将我的颤振应用程序添加到网络
【发布时间】:2021-04-19 17:08:26
【问题描述】:

因为 google_map_location_picker 的每个版本都依赖于来自 sdk 的 flutter_localizations 任何依赖于 intl 0.17.0-nullsafety.2,所以每个版本的 google_map_location_picker 都需要 intl 0.17.0-nullsafety.2。 所以,由于 medivic 依赖于 intl ^0.16.1 和 google_map_location_picker ^3.3.3,版本求解失败。

【问题讨论】:

    标签: flutter web


    【解决方案1】:

    尝试在您的 build.gradle 文件 (android/app/build.gradle) 中将 minSdkVersion 更改为更高版本,并将 compileSdkVersion 更改为 30。

      compileSdkVersion 30
      defaultConfig {
            applicationId "com.app.example"
            minSdkVersion 21
            targetSdkVersion 30
            versionCode flutterVersionCode.toInteger()
            versionName flutterVersionName
        }
    

    运行flutter clean

    如果它不起作用,请转到显示错误/android/build.gradle/ 的外部库/flutter 插件/特定插件

    在 build.gradle 文件更改

    classpath 'com.android.tools.build:gradle:3.5.0'
    

    将此文件与您的 build.gradle 进行比较并更改

    minSdkVersion 21
    

    运行flutter clean

    【讨论】:

      【解决方案2】:

      这是因为google_map_location_picker 有限制intl: '>=0.16.0 <=0.16.1'

      解决方法:将此添加到pubspec.yaml

      dependency_overrides:
        intl: ^0.17.0-nullsafety.2
      

      请务必再次测试插件,以防引起任何问题

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-10-15
        • 2021-07-02
        • 1970-01-01
        • 1970-01-01
        • 2021-08-28
        • 2023-02-16
        • 2020-10-21
        • 2020-10-23
        相关资源
        最近更新 更多