lyming99 / wenznote

一款由 flutter 开发的笔记软件,支持电脑端和手机端。
GNU Affero General Public License v3.0
500 stars 37 forks source link

本地运行失败 #5

Closed hencejacki closed 7 months ago

hencejacki commented 7 months ago

运行命令:

flutter run -d windows

报错信息如下:

Flutter assets will be downloaded from https://mirrors.tuna.tsinghua.edu.cn/flutter. Make sure you trust this source!
Launching lib\main.dart on Windows in debug mode...
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_blurhash-0.7.0/lib/src/blurhash_widget.dart(218,42): error G5FE39F1E: Type 'DecoderCallback' not found. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_blurhash-0.7.0/lib/src/blurhash_image.dart(32,48): error G5FE39F1E: Type 'DecoderCallback' not found. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/super_drag_and_drop-0.3.0+2/lib/src/drag_internal.dart(146,41): error GC2F972A8: The argument type 'HitTestResult Function()' can't be assigned to the parameter type 'HitTestResult?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_blurhash-0.7.0/lib/src/blurhash_widget.dart(218,42): error G93EAFBA7: 'DecoderCallback' isn't a type. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_blurhash-0.7.0/lib/src/blurhash_image.dart(32,48): error G93EAFBA7: 'DecoderCallback' isn't a type. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart(186,20): error GC2F972A8: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart(190,24): error GC2F972A8: The argument type 'void Function(TapUpDetails)' can't be assigned to the parameter type 'void Function(TapDragUpDetails)?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart(195,26): error GC2F972A8: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart(196,31): error GC2F972A8: The argument type 'void Function(DragStartDetails)' can't be assigned to the parameter type 'void Function(TapDragStartDetails)?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart(197,32): error GC2F972A8: The argument type 'void Function(DragStartDetails, DragUpdateDetails)' can't be assigned to the parameter type 'void Function(TapDragUpdateDetails)?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart(198,29): error GC2F972A8: The argument type 'void Function(DragEndDetails)' can't be assigned to the parameter type 'void Function(TapDragEndDetails)?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_layout_grid-1.0.6/lib/src/widgets/layout_grid.dart(212,20): error G55BD5BF6: Inferred type argument 'AutoPlacement' doesn't conform to the bound 'Enum?' of the type variable 'T' on 'EnumProperty'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart(82,55): error G44692867: A value of type 'RenderObject?' can't be assigned to a variable of type 'AbstractNode?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart(83,58): error GE5CFE876: The method 'markNeedsPlacement' isn't defined for the class 'AbstractNode?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart(84,54): error GE5CFE876: The method 'markNeedsLayout' isn't defined for the class 'AbstractNode?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart(132,55): error G44692867: A value of type 'RenderObject?' can't be assigned to a variable of type 'AbstractNode?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart(133,58): error GE5CFE876: The method 'markNeedsPlacement' isn't defined for the class 'AbstractNode?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart(134,54): error GE5CFE876: The method 'markNeedsLayout' isn't defined for the class 'AbstractNode?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/flutter_math_fork-0.5.0/lib/src/widgets/selection/handle_overlay.dart(60,40): error G75B77105: Member not found: 'fadeDuration'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]        
D:\Program Files\VisualStudio\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: ��E:\2023-2024\wenznote\build\windows\x64\CMakeFiles\eb2d397aed59cbb7c585140c6132daf4\flutter_windows.dll.rule;E:\2023-2024\wenznote\build\windows\x64\CMakeFiles\f30392c438e92b68601baff1581b62a0\flutter_assemble.rule;E:\2023-2024\wenznote\windows\flutter\CMakeLists.txt�����Զ����������˳�������Ϊ 1�� [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
D:\Program Files\VisualStudio\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: ��E:\2023-2024\wenznote\build\windows\x64\CMakeFiles\af6a92e7f363b080fed40b4f6fe9a8aa\super_native_extensions.dll.rule;E:\2023-2024\wenznote\build\windows\x64\CMakeFiles\3370a67c96990630db573dcbe181c8f6\super_native_extensions_plugin_cargokit.rule;E:\2023-2024\wenznote\windows\flutter\ephemeral\.plugin_symlinks\super_native_extensions\windows\CMakeLists.txt�����Զ����������˳�������Ϊ 1�� [E:\2023-2024\wenznote\build\windows\x64\plugins\super_native_extensions\super_native_extensions_plugin_cargokit.vcxproj]
Building Windows application...                                    67.5s
Exception: Build process failed.

flutter doctor输出信息如下:

Flutter assets will be downloaded from https://mirrors.tuna.tsinghua.edu.cn/flutter. Make sure you trust this source!
[√] Flutter (Channel stable, 3.16.8, on Microsoft Windows [版本 10.0.22621.3007], locale zh-CN)
    • Flutter version 3.16.8 on channel stable at D:\Android\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 67457e669f (8 days ago), 2024-01-16 16:22:29 -0800
    • Engine revision 6e2ea58a5c
    • Dart version 3.2.5
    • DevTools version 2.28.5
    • Pub download mirror https://mirrors.tuna.tsinghua.edu.cn/dart-pub
    • Flutter download mirror https://mirrors.tuna.tsinghua.edu.cn/flutter

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at D:\Android\JDK
    • Platform android-33, build-tools 30.0.3
    • Java binary at: D:\Android\AS\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
    • Visual Studio at D:\Program Files\VisualStudio
    • Visual Studio Community 2022 version 17.8.34330.188
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2021.3)
    • Android Studio at D:\Android\AS
    • 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 11.0.13+0-b1751.21-8125866)

[√] IntelliJ IDEA Ultimate Edition (version 2021.1)
    • IntelliJ at D:\Program Files\IntelliJ IDEA 2021.1
    • 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

[!] Proxy Configuration
    • HTTP_PROXY is set
    ! NO_PROXY is not set

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.22621.3007]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 120.0.6099.225
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 120.0.2210.144

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

建议作者加上Quick Start,还有就是问下作者的运行环境,谢谢:)

lyming99 commented 7 months ago

super_native_extensions,这个插件用到了cargo,去pub.dev看看这个插件怎么正常使用应该就可以解决了。

lyming99 commented 7 months ago

https://pub.dev/packages/super_drag_and_drop

hencejacki commented 7 months ago

super_native_extensions,这个插件用到了cargo,去pub.dev看看这个插件怎么正常使用应该就可以解决了。

感谢,在本地安装rust后解决了最后一个错误,其他的错误尚未解决,Google之后发现是部分依赖版本的问题,经过升级后运行,目前报错信息少了一些😂:

/C:/Users/Lenovo/AppData/Local/Pub/Cache/hosted/mirrors.tuna.tsinghua.edu.cn%2547dart-pub%2547/super_drag_and_drop-0.3.0+2/lib/src/drag_internal.dart(146,41): error GC2F972A8: The argument type 'HitTestResult Function()' can't be assigned to the parameter type 'HitTestResult?'. [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
D:\Program Files\VisualStudio\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: ��E:\2023-2024\wenznote\build\windows\x64\CMakeFiles\eb2d397aed59cbb7c585140c6132daf4\flutter_windows.dll.rule;E:\2023-2024\wenznote\build\windows\x64\CMakeFiles\f30392c438e92b68601baff1581b62a0\flutter_assemble.rule�����Զ����������˳�������Ϊ 1�� [E:\2023-2024\wenznote\build\windows\x64\flutter\flutter_assemble.vcxproj]
Building Windows application...                                    46.1s
Exception: Build process failed.
lyming99 commented 7 months ago

最后一个问题就是flutter版本问题了,上述错误是系统的api参数不一致导致的

hencejacki commented 7 months ago

最后一个问题就是flutter版本问题了,上述错误是系统的api参数不一致导致的

build是成功了,但最后运行时又出问题了😂:

thread '<unnamed>' panicked at D:\program\rust\.cargo\registry\src\index.crates.io-6f17d22bba15001f\irondash_dart_ffi-0.1.0\src\functions.rs:94:9:
FFI function $Dart_UpdateFinalizableExternalSize not found
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
hencejacki commented 7 months ago

运行出现问题,将如下依赖升级即可运行:

image

最后总结一下解决方案:

  1. 部分代码变更;
  2. Rust安装;
  3. 部分依赖升级;
lyming99 commented 7 months ago

flutter 太神奇了,我重新拉了个代码确实也编译不了。。。

lyming99 commented 7 months ago

运行出现问题,将如下依赖升级即可运行:

image

最后总结一下解决方案:

  1. 部分代码变更;
  2. Rust安装;
  3. 部分依赖升级;

太牛了,我直接把你的依赖拿过来,改了下代码就能用了,并且将flutter升级到最新版本了,直接解决我不能编译ios的问题

hencejacki commented 7 months ago

运行出现问题,将如下依赖升级即可运行: image 最后总结一下解决方案:

  1. 部分代码变更;
  2. Rust安装;
  3. 部分依赖升级;

太牛了,我直接把你的依赖拿过来,改了下代码就能用了,并且将flutter升级到最新版本了,直接解决我不能编译ios的问题

haha,都是试出来的,纠结了两天了