我正试图用Codemagic为iOS编译我的应用程序。在当地,我的环境是:
√Flutter (频道稳定,v1.9.1+hotfix.6,MicrosoftWindowsVersion10.0.18363.657,locale en-US)
√安卓工具链-为安卓设备开发(Android版本28.0.3)
√Android (版本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'.如有任何反馈,我将不胜感激!
发布于 2020-02-29 12:38:49
如果有人遇到类似的问题--在我的例子中,这是由我的pubspec.yaml文件flutter_colorpicker: any中的一行引起的,因为它加载了最近的flutter_colorpicker版本,其中删除了上面的文件。所以基本上,我不得不调整代码以适应最近的版本。此外,作为一个普遍的经验规则-只需将您的插件/包版本设置为一个特定的版本,例如flutter_colorpicker: ^0.3.2。
https://stackoverflow.com/questions/60419774
复制相似问题