Flutter Codemagic 构建失败

问题描述

我正在尝试在使用 Flutter 制作的 Codemagic 中发送应用构建。

我也在使用dependency_overrides

dependency_overrides:
  http: ^0.13.0

在 localy 中工作正常,但在 Codemagic 中出现此错误


> Flutter build apk --release
Running "Flutter pub get" in clone...                           
Warning: You are using these overridden dependencies:

! http 0.13.3
Running "Flutter pub get" in clone...                            2,018ms

Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Running Gradle task 'assembleRelease'...                        
../programs/Flutter/.pub-cache/hosted/pub.dartlang.org/search_map_place-0.3.0/lib/src/geocoding.dart:12:37: Error: The argument type 'String' can't be assigned to the parameter type 'Uri'.

 - 'Uri' is from 'dart:core'.

    final response = await http.get(url);

                                    ^

../programs/Flutter/.pub-cache/hosted/pub.dartlang.org/search_map_place-0.3.0/lib/src/searchMapPlaceWidget.dart:309:37: Error: The argument type 'String' can't be assigned to the parameter type 'Uri'.

 - 'Uri' is from 'dart:core'.

    final response = await http.get(url);

                                    ^

解决方法

您是否使用与本地相同的 Flutter 版本?如果您使用工作流编辑器

,您可以在 App Settings > Build > Flutter version 中查找和更改 Flutter 版本