WFlutterDemo icon indicating copy to clipboard operation
WFlutterDemo copied to clipboard

新版 SDK 编译失败:亲测 Flutter SDK 版本 1.17.4 和 Dart 2.8.4 可以运行

Open hornhuang opened this issue 4 years ago • 1 comments

如果使用最新的版本会编译失败

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running Xcode build...
    ../../../flutter/flutter/packages/flutter/lib/src/rendering/editable.dart:1120:16: Error: Null safety features are disabled for this library.
    Try removing the package language version or setting the language version to 2.10 or higher.
          selection!,
                   ^
    ../../../flutter/flutter/packages/flutter/lib/src/rendering/editable.dart:1126:35: Error: Null safety features are disabled for this library.
    Try removing the package language version or setting the language version to 2.10 or higher.
        final int distance = selection!.extentOffset - nextSelection.extentOffset;
                                      ^
    ../../../flutter/flutter/packages/flutter/lib/src/rendering/editable.dart:1160:55: Error: Null safety features are disabled for this library.
    Try removing the package language version or setting the language version to 2.10 or higher.
        final int startPoint = previousCharacter(selection!.extentOffset, _plainText, false);
......(省略)
                    ^^^^
    ../../../flutter/flutter/packages/flutter/lib/src/semantics/semantics.dart:114:9: Error: Final field 'action' is not initialized by this constructor.
    Try to initialize the field using an initializing formal or a field initializer.
      const CustomSemanticsAction.overridingAction({required String this.hint, required SemanticsAction this.action})
            ^^^^^^^^^^^^^^^^
    ../../../flutter/flutter/packages/flutter/lib/src/semantics/semantics.dart:127:26: Context: 'action' is defined here.
      final SemanticsAction? action;
                             ^^^^^^
    Unhandled exception:
    FileSystemException(uri=org-dartlang-untranslatable-uri:package%3Acharacters%2Fcharacters.dart; message=StandardFileSystem only supports file:* and data:* URIs)
    #0      StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:36:7)
    #1      asFileUri (package:vm/kernel_front_end.dart:599:37)
    #2      writeDepfile (package:vm/kernel_front_end.dart:738:21)
    <asynchronous suspension>
    #3      FrontendCompiler.compile (package:frontend_server/frontend_server.dart:562:9)
    <asynchronous suspension>
    #4      starter (package:flutter_frontend_server/server.dart:180:12)
    <asynchronous suspension>
    #5      main (file:///opt/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:13:24)
    <asynchronous suspension>


    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
    /Users/sunshine/Documents/GitHub/WFlutterDemo/wx_demo_project/ios/Runner.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Runner' from project 'Runner')

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

hornhuang avatar Jul 12 '21 15:07 hornhuang

正确的 flutter 版本,亲测可以运行

Flutter 1.17.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 1ad9baa8b9 (1 year, 1 month ago) • 2020-06-17 14:41:16
-0700
Engine • revision ee76268252
Tools • Dart 2.8.4

hornhuang avatar Jul 12 '21 15:07 hornhuang