【发布时间】:2021-06-04 01:51:21
【问题描述】:
颤振 2.0.1 飞镖 2.12
我在模拟器上构建 iOS 应用时遇到问题。 (iOS 14.4) 构建停止并抛出下面列出的错误:
** BUILD FAILED **
Xcode's output:
↳
../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.4.0/lib/flutter_datetime_picker.dart:215:48: Error: No named parameter with the name 'shadowThemeOnly'.
ThemeData inheritTheme = Theme.of(context, shadowThemeOnly: true);
^^^^^^^^^^^^^^
../Developer/flutter/packages/flutter/lib/src/material/theme.dart:107:20: Context: Found this candidate, but the arguments don't match.
static ThemeData of(BuildContext context) {
^^
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
我读到 Theme.of 已被 InheritedTheme/或 InheritTheme 替换,但是当我查看问题时,我收到了列出的文件不存在的消息(示例如下)
Unable to open 'theme.dart': Unable to read file '/Users/userName/hdk/Developer/flutter/packages/flutter/lib/src/material/theme.dart'
(Error: Unable to resolve non-existing file '/Users/userName/hdk/Developer/flutter/packages/flutter/lib/src/material/theme.dart').
颤振医生:
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-x64, locale pl-PL)
• Flutter version 2.0.1 at /Users/paweljagla/Developer/flutter
• Framework revision c5a4b4029c (17 hours ago), 2021-03-04 09:47:48 -0800
• Engine revision 40441def69
• Dart version 2.12.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/paweljagla/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
???? https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
???? https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] Connected device (2 available)
• iPhone 11 Pro Max (mobile) • 87DDB2A3-2284-4D85-A835-FE842809E6E9 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4
(simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.192
我尝试过:清理、更新颤振、更新软件包、重新安装颤振,但没有任何效果。如何摆脱这个错误?有什么想法吗?
【问题讨论】: