Codemagic iOS 构建问题

Codemagic iOS build issue

我正在尝试使用 CodemagiciOS 编译我的应用程序。在本地,我的环境是:

[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18363.657], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)

[√] Android Studio (version 3.5)

我可以编译成 Android 应用程序。 但是,当我切换到 Codemagic 时,我将配置设置为:

Flutter 1.9.1+hotfix.6
Xcode 11.1

我报告了以下错误:

Compiler message:
lib/app/ui/widgets/color_theme_picker_widget.dart:2:8: Error: Error when reading '../programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_colorpicker-0.3.2/lib/block_picker.dart': No such file or directory

import 'package:flutter_colorpicker/block_picker.dart';
       ^
lib/app/ui/widgets/color_theme_picker_widget.dart:35:28: Error: Method not found: 'BlockPicker'.
                    child: BlockPicker(
                           ^^^^^^^^^^^
lib/app/ui/widgets/color_theme_picker_widget.dart:35:28: Error: The method 'BlockPicker' isn't defined for the class 'ColorThemePicker'.
 - 'ColorThemePicker' is from 'package:biorhythms/app/ui/widgets/color_theme_picker_widget.dart' ('lib/app/ui/widgets/color_theme_picker_widget.dart').
Try correcting the name to the name of an existing method, or defining a method named 'BlockPicker'.

如果有任何反馈,我将不胜感激, 谢谢!

万一有人遇到类似的问题 - 在我的例子中,它是由我的 pubspec.yaml 文件中的以下行引起的 - flutter_colorpicker: any,因为它加载了最新的 flutter_colorpicker 版本,其中上述文件已被删除。所以基本上,我不得不将代码调整到最新版本。同样作为一般经验法则 - 只需将您的插件/包版本设置为特定版本,例如flutter_colorpicker: ^0.3.2