fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.

Home Page:https://fzyzcjy.github.io/flutter_rust_bridge/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SEVERE: error[E0107]: type alias takes 1 generic argument but 2 generic arguments were supplied

tingfeng-key opened this issue · comments

Describe the bug

SEVERE: error[E0107]: type alias takes 1 generic argument but 2 generic arguments were supplied

Steps to reproduce

Hint: A simple way to reproduce is to clone and modify the https://github.com/fzyzcjy/flutter_rust_bridge/tree/master/frb_example/dart_minimal example package according to your needs.

  1. ...
  2. ...
  3. ...

Logs

SEVERE: error[E0107]: type alias takes 1 generic argument but 2 generic arguments were supplied
  SEVERE: error[E0107]: type alias takes 1 generic argument but 2 generic arguments were supplied
  SEVERE: error[E0107]: type alias takes 1 generic argument but 2 generic arguments were supplied
SEVERE : error : could not compile `rust_lib` (lib) due to 5 previous errors

Expected behavior

No response

Generated binding code

No response

OS

Windows 10

Version of flutter_rust_bridge_codegen

No response

Flutter info

[√] Flutter (Channel stable, 3.16.9, on Microsoft Windows [版本 10.0.19045.3930], locale
    zh-CN)
    • Flutter version 3.16.9 on channel stable at D:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 41456452f2 (4 days ago), 2024-01-25 10:06:23 -0800
    • Engine revision f40e976bed
    • Dart version 3.2.6
    • DevTools version 2.28.5

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

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at D:\Program Files\Android
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = C:\Users\ld_100\AppData\Local\Android\Sdk
    • ANDROID_SDK_ROOT = C:\Users\ld_100\AppData\Local\Android\Sdk
    • Java binary at:
      C:\Users\ld_100\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\231.9392.1.2      311.11330709\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • 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.7.4)
    • Visual Studio at D:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.7.34031.279
    • Windows 10 SDK version 10.0.20348.0

[√] Android Studio (version 2023.1)
    • Android Studio at
      C:\Users\ld_100\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\231.9392.1.2      311.11330709
    • 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 17.0.7+0-b2043.56-10550314)

[√] IntelliJ IDEA Ultimate Edition (version 2023.2)
    • IntelliJ at
      C:\Users\ld_100\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\232.8660.185
    • 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

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

Version of clang++

No response

Additional context

No response

Hi! Thanks for opening your first issue here! 😄

Hi, this seems to be a rust compilation error. could you please paste more full error (e.g. flutter run --verbose and look at relavant parts), as well as related parts of Rust code

[ +126 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping
update.
[   +3 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.    
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.  
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.  
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping      
update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping      
update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping     
update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping     
update.
[  +40 ms] executing: D:\Program Files\Android\platform-tools\adb.exe devices -l
[  +84 ms] List of devices attached
[   +4 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping 
update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.    
[   +5 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.  
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.  
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping      
update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping      
update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping     
update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping
update.
[  +63 ms] Connected devices:
[  +41 ms] Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本
10.0.19045.3930]
[   +1 ms] Chrome (web)      • chrome  • web-javascript • Google Chrome 118.0.5993.71
[        ] Edge (web)        • edge    • web-javascript • Microsoft Edge 121.0.2277.83    
[        ] [1]: Windows (windows)
[        ] [2]: Chrome (chrome)
[        ] [3]: Edge (edge)
[   +1 ms] Please choose one (or "q" to quit)
[        ] : 
[+8178 ms] 1
[   +9 ms] Skipping pub get: version match.
[  +78 ms] Found plugin integration_test at D:\flutter\packages\integration_test\
[  +11 ms] Found plugin rust_builder at D:\learns\telegramhelperflutter\rust_builder\
[ +150 ms] Found plugin integration_test at D:\flutter\packages\integration_test\
[   +3 ms] Found plugin rust_builder at D:\learns\telegramhelperflutter\rust_builder\
[  +50 ms] Found plugin integration_test at D:\flutter\packages\integration_test\
[   +3 ms] Found plugin rust_builder at D:\learns\telegramhelperflutter\rust_builder\
[  +57 ms] Generating
D:\learns\telegramhelperflutter\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +92 ms] Initializing file store
[   +6 ms] Skipping target: gen_localizations
[   +3 ms] gen_dart_plugin_registrant: Starting due to
{InvalidatedReasonKind.inputChanged: The following inputs have updated contents:
D:\learns\telegramhelperflutter\.dart_tool\package_config_subset}
[ +141 ms] Found plugin integration_test at D:\flutter\packages\integration_test\
[   +2 ms] Found plugin rust_builder at D:\learns\telegramhelperflutter\rust_builder\
[   +3 ms] gen_dart_plugin_registrant: Complete
[   +2 ms] Skipping target: _composite
[   +1 ms] complete
[   +4 ms] Launching lib\main.dart on Windows in debug mode...
[   +2 ms] D:\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
D:\flutter\bin\cache\dart-sdk\bin\snapshots\frontend_server.dart.snapshot --sdk-root      
D:\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental
--target=flutter --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true        
-DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/f40e976bedff57e69e1b3d89a7c2a3c617a03dad/ --output-dill
C:\Users\ld_100\AppData\Local\Temp\flutter_tools.451f23c8\flutter_tool.2523dac0\app.dill  
--packages D:\learns\telegramhelperflutter\.dart_tool\package_config.json
-Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation  
--filesystem-scheme org-dartlang-root --initialize-from-dill
build\9ffe3fb9e2063e195ddfbcea0cabcfef.cache.dill.track.dill --verbosity=error
--enable-experiment=alternative-invalidation-strategy
[  +22 ms] executing: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe-format json -products * -utf8 -latest -version 16 -requires
Microsoft.VisualStudio.Workload.NativeDesktop
Microsoft.VisualStudio.Component.VC.Tools.x86.x64
Microsoft.VisualStudio.Component.VC.CMake.Project
[  +57 ms] Exit code 0 from: C:\Program Files (x86)\Microsoft Visual
Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version 16 -requires 
Microsoft.VisualStudio.Workload.NativeDesktop
Microsoft.VisualStudio.Component.VC.Tools.x86.x64
Microsoft.VisualStudio.Component.VC.CMake.Project
[   +1 ms] [
             {
               "instanceId": "a25ba848",
               "installDate": "2021-11-30T03:04:06Z",
               "installationName": "VisualStudio/17.7.4+34031.279",
               "installationPath": "D:\\Program Files\\Microsoft Visual
               Studio\\2022\\Community",
               "installationVersion": "17.7.34031.279",
               "productId": "Microsoft.VisualStudio.Product.Community",
               "productPath": "D:\\Program Files\\Microsoft Visual
               Studio\\2022\\Community\\Common7\\IDE\\devenv.exe",
               "state": 4294967295,
               "isComplete": true,
               "isLaunchable": true,
               "isPrerelease": false,
               "isRebootRequired": false,
               "displayName": "Visual Studio Community 2022",
               "description": "功能强大的 IDE,供学生、开放源代码参与者和个人免费使用",   
               "channelId": "VisualStudio.17.Release",
               "channelUri": "https://aka.ms/vs/17/release/channel",
               "enginePath": "C:\\Program Files (x86)\\Microsoft Visual
               Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualSt               udio.Setup.Service",
               "installedChannelId": "VisualStudio.17.Release",
               "installedChannelUri": "https://aka.ms/vs/17/release/channel",
               "releaseNotes":
               "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-               v17.7#17.7.4",
               "thirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288",     
               "updateDate": "2023-09-20T01:45:26.7488756Z",
               "catalog": {
                 "buildBranch": "d17.7",
                 "buildVersion": "17.7.34031.279",
                 "id": "VisualStudio/17.7.4+34031.279",
                 "localBuild": "build-lab",
                 "manifestName": "VisualStudio",
                 "manifestType": "installer",
                 "productDisplayVersion": "17.7.4",
                 "productLine": "Dev17",
                 "productLineVersion": "2022",
                 "productMilestone": "RTW",
                 "productMilestoneIsPreRelease": "False",
                 "productName": "Visual Studio",
                 "productPatchVersion": "4",
                 "productPreReleaseMilestoneSuffix": "1.0",
                 "productSemanticVersion": "17.7.4+34031.279",
                 "requiredEngineVersion": "3.7.2181.36443"
               },
               "properties": {
                 "campaignId": "413480765.1624340717",
                 "canceled": "0",
                 "channelManifestId": "VisualStudio.17.Release/17.7.4+34031.279",
                 "nickname": "",
                 "setupEngineFilePath": "C:\\Program Files (x86)\\Microsoft Visual        
                 Studio\\Installer\\setup.exe"
               }
             }
           ]
[   +9 ms] Building Windows application...
[  +32 ms] <- compile package:telegramhelperflutter/main.dart
[   +2 ms] executing: D:\Program Files\Microsoft Visual
Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -S 
D:\learns\telegramhelperflutter\windows -B build\windows\x64 -G Visual Studio 17 2022 -A  
x64 -DFLUTTER_TARGET_PLATFORM=windows-x64
[ +130 ms] -- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.19045.
[ +425 ms] -- Configuring done (0.4s)
[  +67 ms] -- Generating done (0.1s)
[   +4 ms] -- Build files have been written to:
D:/learns/telegramhelperflutter/build/windows/x64
[   +7 ms] executing: D:\Program Files\Microsoft Visual
Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe    
--build build\windows\x64 --config Debug --target INSTALL --verbose
[ +236 ms] ������ .NET Framework MSBuild �汾 17.7.2+d6990bcfa
[  +52 ms] ��������ʱ��Ϊ 2024/1/30 11:07:19��
[ +246 ms] �ڵ� 1
�ϵ���Ŀ��D:\learns\telegramhelperflutter\build\windows\x64\INSTALL.vcxproj��(Ĭ��Ŀ��)��     
[   +1 ms]
��Ŀ��D:\learns\telegramhelperflutter\build\windows\x64\INSTALL.vcxproj��(1)���ڽڵ� 1       
�����ɡ�D:\learns\telegramhelperflutter\build\windows\x64\ZERO_CHECK.vcxproj��(2)
(Ĭ��Ŀ��)��
[   +1 ms] InitializeBuildStatus:
[        ]
���ڴ�����x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild������Ϊ��ָ����AlwaysCreate�
���
[   +1 ms]   ���ڶԡ�x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild��ִ�� Touch ���� 
[  +20 ms] CustomBuild:
[        ]   ���������Ϊ���¡�
[  +29 ms] FinalizeBuildStatus:
[   +1 ms]   ����ɾ���ļ���x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild����
[   +1 ms]   ���ڶԡ�x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate��ִ��    
Touch ����
[   +1 ms]
�����������Ŀ��D:\learns\telegramhelperflutter\build\windows\x64\ZERO_CHECK.vcxproj��(Ĭ��Ŀ��)�IJ�����
[  +55 ms]
��Ŀ��D:\learns\telegramhelperflutter\build\windows\x64\INSTALL.vcxproj��(1)���ڽڵ� 1       
�����ɡ�D:\learns\telegramhelperflutter\build\windows\x64\ALL_BUILD.vcxproj��(3) (Ĭ��Ŀ��)��[   +1 ms]
��Ŀ��D:\learns\telegramhelperflutter\build\windows\x64\ALL_BUILD.vcxproj��(3)���ڽڵ� 1     
�����ɡ�D:\learns\telegramhelperflutter\build\windows\x64\plugins\rust_builder\rust_builder_cargokit.vcxproj��(4) (Ĭ��Ŀ��)��
[   +1 ms] InitializeBuildStatus:
[        ]
���ڴ�����x64\Debug\rust_builder_cargokit\rust_bui.B8D3706E.tlog\unsuccessfulbuild������Ϊ��ָ����AlwaysCreate����
[        ]
���ڶԡ�x64\Debug\rust_builder_cargokit\rust_bui.B8D3706E.tlog\unsuccessfulbuild��ִ�� Touch 
����
[  +12 ms] CustomBuild:
[        ]
����D:\learns\telegramhelperflutter\build\windows\x64\CMakeFiles\bdefb31b79244650d366a66f4cd87214\rust_builder_cargokit.rule���������������ɡ�D:\learns\telegramhelperflutter\build\windows\x64\CMakeFiles\de39d543fd2700d8154e65e18658c5e0\rust_lib.dll.rule���������������ġ�D:\LEARNS\TELEGRAMHELPERFLUTTER\BUILD\WINDOWS\X64\PLUGINS\RUST_BUILDER\DEBUG\RUST_LIB.DLL�����޷������������
[  +69 ms]   Generating Debug/rust_lib.dll, _phony_
[ +397 ms]   INFO: Precompiled binaries are disabled
[ +420 ms]   INFO: Building rust_lib for x86_64-pc-windows-msvc
[ +831 ms]   SEVERE:
================================================================================
[   +7 ms] SEVERE : Cargokit BuildTool failed with error :
[D:\learns\telegramhelperflutter\build\windows\x64\plugins\rust_builder\rust_builder_cargokit.vcxproj]
[   +1 ms]   SEVERE:
--------------------------------------------------------------------------------
[        ]   SEVERE: External Command: rustup "run" "stable" "cargo" "build"
"--manifest-path" "D:\learns\telegramhelperflutter\rust\Cargo.toml" "-p" "rust_lib"       
"--target" "x86_64-pc-windows-msvc" "--target-dir"
"D:/learns/telegramhelperflutter/build/windows/x64/plugins/rust_builder/cargokit_build"   
[        ]   SEVERE: Returned Exit Code: 101
[        ]   SEVERE:
--------------------------------------------------------------------------------
[        ]   SEVERE: STDOUT:
[        ]   SEVERE:
--------------------------------------------------------------------------------
[        ]   SEVERE: STDERR:
[   +1 ms]   SEVERE: Compiling rust_lib v0.1.0 (D:\learns\telegramhelperflutter\rust)     
[   +1 ms]   SEVERE: error[E0107]: type alias takes 1 generic argument but 2 generic      
arguments were supplied
[   +3 ms]   SEVERE:   --> src\frb_generated.rs:29:1
[        ]   SEVERE:    |
[        ]   SEVERE: 29 | / flutter_rust_bridge::frb_generated_boilerplate!(
[        ]   SEVERE: 30 | |     default_stream_sink_codec = SseCodec,
[        ]   SEVERE: 31 | |     default_rust_opaque = RustOpaqueMoi,
[        ]   SEVERE: 32 | |     default_rust_auto_opaque = RustAutoOpaqueMoi,
[        ]   SEVERE: 33 | | );
[        ]   SEVERE:    | | ^
[        ]   SEVERE:    | | |
[        ]   SEVERE:    | |_expected 1 generic argument
[        ]   SEVERE:    |   help: remove this generic argument
[        ]   SEVERE:    |
[        ]   SEVERE: note: type alias defined here, with 1 generic parameter: `T`
[        ]   SEVERE:   --> D:\learns\telegramhelperflutter\libs\src\error.rs:1:10
[        ]   SEVERE:    |
[        ]   SEVERE: 1  | pub type Result<T> = std::result::Result<T, AppError>;
[        ]   SEVERE:    |          ^^^^^^ -
[        ]   SEVERE:    = note: this error originates in the macro
`$crate::frb_generated_sse_codec` which comes from the expansion of the macro
`flutter_rust_bridge::frb_generated_boilerplate` (in Nightly builds, run with -Z
macro-backtrace for more info)
[        ]   SEVERE:
[        ]   SEVERE: error[E0107]: type alias takes 1 generic argument but 2 generic
arguments were supplied
[   +1 ms]   SEVERE:   --> src\frb_generated.rs:29:1
[        ]   SEVERE:    |
[        ]   SEVERE: 29 | / flutter_rust_bridge::frb_generated_boilerplate!(
[        ]   SEVERE: 30 | |     default_stream_sink_codec = SseCodec,
[        ]   SEVERE: 31 | |     default_rust_opaque = RustOpaqueMoi,
[        ]   SEVERE: 32 | |     default_rust_auto_opaque = RustAutoOpaqueMoi,
[        ]   SEVERE: 33 | | );
[        ]   SEVERE:    | | ^
[        ]   SEVERE:    | | |
[        ]   SEVERE:    | |_expected 1 generic argument
[        ]   SEVERE:    |   help: remove this generic argument
[        ]   SEVERE:    |
[        ]   SEVERE: note: type alias defined here, with 1 generic parameter: `T`
[        ]   SEVERE:   --> D:\learns\telegramhelperflutter\libs\src\error.rs:1:10
[        ]   SEVERE:    |
[        ]   SEVERE: 1  | pub type Result<T> = std::result::Result<T, AppError>;
[        ]   SEVERE:    |          ^^^^^^ -
[        ]   SEVERE:    = note: this error originates in the macro
`$crate::frb_generated_moi_arc_def` which comes from the expansion of the macro
`flutter_rust_bridge::frb_generated_boilerplate` (in Nightly builds, run with -Z
macro-backtrace for more info)
[   +1 ms]   SEVERE:
[        ]   SEVERE: error[E0107]: type alias takes 1 generic argument but 2 generic      
arguments were supplied
[        ]   SEVERE:   --> src\frb_generated.rs:29:1
[        ]   SEVERE:    |
[        ]   SEVERE: 29 | / flutter_rust_bridge::frb_generated_boilerplate!(
[        ]   SEVERE: 30 | |     default_stream_sink_codec = SseCodec,
[        ]   SEVERE: 31 | |     default_rust_opaque = RustOpaqueMoi,
[        ]   SEVERE: 32 | |     default_rust_auto_opaque = RustAutoOpaqueMoi,
[        ]   SEVERE: 33 | | );
[        ]   SEVERE:    | | ^
[        ]   SEVERE:    | | |
[        ]   SEVERE:    | |_expected 1 generic argument
[        ]   SEVERE:    |   help: remove this generic argument
[        ]   SEVERE:    |
[        ]   SEVERE: note: type alias defined here, with 1 generic parameter: `T`
[        ]   SEVERE:   --> D:\learns\telegramhelperflutter\libs\src\error.rs:1:10
[        ]   SEVERE:    |
[        ]   SEVERE: 1  | pub type Result<T> = std::result::Result<T, AppError>;
[        ]   SEVERE:    |          ^^^^^^ -
[        ]   SEVERE:    = note: this error originates in the macro
`$crate::frb_generated_stream_sink` which comes from the expansion of the macro
`flutter_rust_bridge::frb_generated_boilerplate` (in Nightly builds, run with -Z
macro-backtrace for more info)
[        ]   SEVERE:
[        ]   SEVERE: For more information about this error, try `rustc --explain E0107`.  
[        ] SEVERE : error : could not compile `rust_lib` (lib) due to 5 previous errors   
[D:\learns\telegramhelperflutter\build\windows\x64\plugins\rust_builder\rust_builder_cargokit.vcxproj]
[        ]   SEVERE:
--------------------------------------------------------------------------------
[        ]   SEVERE: #0      runCommand (package:build_tool/src/util.dart:121:5)
[        ]   SEVERE: #1      RustBuilder.build (package:build_tool/src/builder.dart:142:5)[        ]   SEVERE: <asynchronous suspension>
[        ]   SEVERE: #2      ArtifactProvider.getArtifacts
(package:build_tool/src/artifacts_provider.dart:71:25)
[        ]   SEVERE: <asynchronous suspension>
[        ]   SEVERE: #3      BuildCMake.build
(package:build_tool/src/build_cmake.dart:29:23)
[        ]   SEVERE: <asynchronous suspension>
[        ]   SEVERE: #4      BuildCMakeCommand.runBuildCommand
(package:build_tool/src/build_tool.dart:79:5)
[        ]   SEVERE: <asynchronous suspension>
[        ]   SEVERE: #5      BuildCommand.run
(package:build_tool/src/build_tool.dart:37:5)
[        ]   SEVERE: <asynchronous suspension>
[        ]   SEVERE: #6      CommandRunner.runCommand
(package:args/command_runner.dart:212:13)
[        ]   SEVERE: <asynchronous suspension>
[        ]   SEVERE: #7      runMain (package:build_tool/src/build_tool.dart:251:5)       
[        ]   SEVERE: <asynchronous suspension>
[        ]   SEVERE:
--------------------------------------------------------------------------------
[        ]   SEVERE: BuildTool arguments: [build-cmake]
[        ]   SEVERE:
================================================================================
[        ] D:\Program Files\Microsoft Visual
Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(249,5): error 
MSB8066:
��D:\learns\telegramhelperflutter\build\windows\x64\CMakeFiles\de39d543fd2700d8154e65e18658c5e0\rust_lib.dll.rule;D:\learns\telegramhelperflutter\build\windows\x64\CMakeFiles\bdefb31b79244650d366a66f4cd87214\rust_builder_cargokit.rule�����Զ����������˳�������Ϊ -1��      
[D:\learns\telegramhelperflutter\build\windows\x64\plugins\rust_builder\rust_builder_cargokit.vcxproj]
[        ]
�����������Ŀ��D:\learns\telegramhelperflutter\build\windows\x64\plugins\rust_builder\rust_builder_cargokit.vcxproj��(Ĭ��Ŀ��)�IJ��� - ʧ�ܡ�
[        ]
�����������Ŀ��D:\learns\telegramhelperflutter\build\windows\x64\ALL_BUILD.vcxproj��(Ĭ��Ŀ��)�IJ��� - ʧ�ܡ�
[        ]
�����������Ŀ��D:\learns\telegramhelperflutter\build\windows\x64\INSTALL.vcxproj��(Ĭ��Ŀ��)�IJ��� - ʧ�ܡ�
[        ] ����ʧ�ܡ�
[        ] ��D:\learns\telegramhelperflutter\build\windows\x64\INSTALL.vcxproj��(Ĭ��Ŀ��)  
(1) ->
[        ] ��D:\learns\telegramhelperflutter\build\windows\x64\ALL_BUILD.vcxproj��(Ĭ��Ŀ��)(3) ->
[        ]
��D:\learns\telegramhelperflutter\build\windows\x64\plugins\rust_builder\rust_builder_cargokit.vcxproj��(Ĭ��Ŀ��) (4) ->
[        ] (CustomBuild Ŀ��) ->
[        ]   SEVERE : Cargokit BuildTool failed with error :
[D:\learns\telegramhelperflutter\build\windows\x64\plugins\rust_builder\rust_builder_cargokit.vcxproj]
[        ]   SEVERE : error : could not compile `rust_lib` (lib) due to 5 previous errors 
[D:\learns\telegramhelperflutter\build\windows\x64\plugins\rust_builder\rust_builder_cargokit.vcxproj]
[        ]   D:\Program Files\Microsoft Visual
Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(249,5): error 
MSB8066:
��D:\learns\telegramhelperflutter\build\windows\x64\CMakeFiles\de39d543fd2700d8154e65e18658c5e0\rust_lib.dll.rule;D:\learns\telegramhelperflutter\build\windows\x64\CMakeFiles\bdefb31b79244650d366a66f4cd87214\rust_builder_cargokit.rule�����Զ����������˳�������Ϊ -1��      
[D:\learns\telegramhelperflutter\build\windows\x64\plugins\rust_builder\rust_builder_cargokit.vcxproj]
[   +1 ms]     0 ������
[        ]     3 ������
[        ] ����ʱ�� 00:00:02.15
[  +13 ms] Building Windows application... (completed in 3.1s)
[        ] Exception: Build process failed.
[   +1 ms] "flutter run" took 12,319ms.
[   +2 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)        
           #1      RunCommand.runCommand
(package:flutter_tools/src/commands/run.dart:790:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command.dart:1367:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure>
           (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:212:13)     
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command_runner.dart:348:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure>
           (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand
           (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure>
           (package:flutter_tools/runner.dart:112:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure>
           (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>


[  +82 ms] ensureAnalyticsSent: 79ms
[        ] Running 1 shutdown hook
[   +3 ms] Shutdown hooks complete
[        ] exiting with code 1

Hmm, looks like you define your custom pub type Result and this confuses the system. A simple workaround is to remove the type alias and use Result<YourType, AppError>. Another way may be to let flutter_rust_bridge understand things with same name but different paths (e.g. differenciate your_crate::Result with std Result), but this may be a bit nontrivial because it may need much information.

OK, thanks for your answer

You are welcome!

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.