LoginSignup
0
0

More than 1 year has passed since last update.

flutterバグ解消(DiagnosticableMixin not found)

Posted at

バグ解消時のメモ

flutter_svgの非互換によるバグが発生。下記issueを元に解決を図ったので、メモ程度に投稿

バグ内容
~/develop/flutter/Google-Calendar-API-Flutter-Example- $ flutter run
Warning: You are using these overridden dependencies:
! flutter_svg 0.17.4 (1.0.0 available)
Running "flutter pub get" in Google-Calendar-API-Flutter-Example-...         3.3s
Launching lib/main.dart on iPhone 13 Pro in debug mode...
Running Xcode build...                                                  
Xcode build done.                                           16.0s
Failed to build iOS app
Error output from Xcode build:

    ** BUILD FAILED **


Xcode's output:
↳
    ../../../.asdf/installs/flutter/2.8.0-stable/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:28: Error: Type 'DiagnosticableMixin' not found.
    class DatePickerTheme with DiagnosticableMixin {
                               ^^^^^^^^^^^^^^^^^^^
    ../../../.asdf/installs/flutter/2.8.0-stable/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.3.8/lib/src/datetime_picker_theme.dart:6:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
    class DatePickerTheme with DiagnosticableMixin {
          ^
    ../../../.asdf/installs/flutter/2.8.0-stable/.pub-cache/hosted/pub.dartlang.org/flutter_datetime_picker-1.3.8/lib/flutter_datetime_picker.dart:215:48: Error: No named parameter with the name 'shadowThemeOnly'.
        ThemeData inheritTheme = Theme.of(context, shadowThemeOnly: true);
                                                   ^^^^^^^^^^^^^^^
    ../../../.asdf/installs/flutter/2.8.0-stable/packages/flutter/lib/src/material/theme.dart:106:20: Context: Found this candidate, but the arguments don't match.
      static ThemeData of(BuildContext context) {
                       ^^
    Failed to package /Users/kawamurakouji/develop/flutter/Google-Calendar-API-Flutter-Example-.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order

Could not build the application for the simulator.
Error launching application on iPhone 13 Pro.

バグの解消方法

pubspec.ymlに下記を追加し、pubspec.lockを削除のうえ、ビルドしなおす。

pubspec.yml
dependency_overrides:
   flutter_svg: ^0.17.4

■参考
https://github.com/dnfield/flutter_svg/issues/368

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0