Newly created projects don't build on Windows
Unbreathable opened this issue · comments
Describe the bug
I literally don't know what I'm doing wrong. I installed the newest version (2.0) of flutter_rust_bridge_codegen and then created a project. When running it, I get the error below. I'm sorry if this is just me being stupid.
Steps to reproduce
- Run the project on Windows 11.
- Create a project using the CLI (
flutter_rust_bridge_codegen create my_app
). - Try to run the project.
Logs
[ +5 ms] <- compile package:chatapp/main.dart
[ +1 ms] executing: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -S C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\windows -B C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64 -G Visual Studio 17 2022 -A x64 -DFLUTTER_TARGET_PLATFORM=windows-x64
[ +43 ms] -- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22631.
[ +916 ms] -- Configuring done (0.9s)
[ +309 ms] -- Generating done (0.3s)
[ +33 ms] -- Build files have been written to: C:/Users/thisi/OneDrive/Dokumente/We(e)b Stuff/liphium/chatapp/build/windows/x64
[ +15 ms] executing: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe --build C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\build\windows\x64 --config Debug --target INSTALL --verbose
[ +112 ms] MSBuild version 17.6.3+07e294721 for .NET Framework
[ +194 ms] Build started 08.03.2024 14:24:46.
[ +751 ms] Project "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\INSTALL.vcxproj" on node 1 (default targets).
[ ] Project "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\INSTALL.vcxproj" (1) is building "C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\build\windows\x64\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
[ ] InitializeBuildStatus:
[ ] Creating "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
[ +41 ms] CustomBuild:
[ ] All outputs are up-to-date.
[ +50 ms] Checking Build System
[ +55 ms] FinalizeBuildStatus:
[ ] Deleting file "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
[ ] Touching "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
[ +3 ms] Done Building Project "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\ZERO_CHECK.vcxproj" (default targets).
[ +53 ms] Project "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\INSTALL.vcxproj" (1) is building "C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\build\windows\x64\ALL_BUILD.vcxproj" (3) on node 1 (default targets).
[ ] Project "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\ALL_BUILD.vcxproj" (3) is building "C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\build\windows\x64\plugins\rust_lib_chatapp\rust_lib_chatapp_cargokit.vcxproj" (4) on node 1 (default targets).
[ ] InitializeBuildStatus:
[ ] Touching "x64\Debug\rust_lib_chatapp_cargokit\rust_lib.BDB642FD.tlog\unsuccessfulbuild".
[ +5 ms] CustomBuild:
[ ] "The build of 'C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\CMakeFiles\93546235075c2c518944ccf2435ad857\rust_lib_chatapp_cargokit.rule' depends
on 'C:\USERS\THISI\ONEDRIVE\DOKUMENTE\WE(E)B STUFF\LIPHIUM\CHATAPP\BUILD\WINDOWS\X64\PLUGINS\RUST_LIB_CHATAPP\DEBUG\RUST_LIB_CHATAPP.DLL' which is produced by the build of
'C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\CMakeFiles\34d09327d0e9721e135c3ae11b70bac0\rust_lib_chatapp.dll.rule'. The items cannot be built in parallel."
[ +47 ms] Generating Debug/rust_lib_chatapp.dll, _phony_
[ +25 ms] b was unexpected at this time.
[ +16 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build for
'C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\CMakeFiles\34d09327d0e9721e135c3ae11b70bac0\rust_lib_chatapp.dll.rule;C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\build\windows\x64\CMakeFiles\93546235075c2c518944ccf2435ad857\rust_lib_chatapp_cargokit.rule' exited with code 255. [C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\build\windows\x64\plugins\rust_lib_chatapp\rust_lib_chatapp_cargokit.vcxproj]
[ +2 ms] Done Building Project "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\plugins\rust_lib_chatapp\rust_lib_chatapp_cargokit.vcxproj" (default targets)
-- FAILED.
[ ] Done Building Project "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\ALL_BUILD.vcxproj" (default targets) -- FAILED.
[ ] Done Building Project "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\INSTALL.vcxproj" (default targets) -- FAILED.
[ +16 ms] Build FAILED.
[ +2 ms] "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\INSTALL.vcxproj" (default target) (1) ->
[ ] "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\ALL_BUILD.vcxproj" (default target) (3) ->
[ ] "C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\plugins\rust_lib_chatapp\rust_lib_chatapp_cargokit.vcxproj" (default target) (4) ->
[ ] (CustomBuild target) ->
[ ] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build for
'C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\CMakeFiles\34d09327d0e9721e135c3ae11b70bac0\rust_lib_chatapp.dll.rule;C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\build\windows\x64\CMakeFiles\93546235075c2c518944ccf2435ad857\rust_lib_chatapp_cargokit.rule' exited with code 255. [C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\build\windows\x64\plugins\rust_lib_chatapp\rust_lib_chatapp_cargokit.vcxproj]
[ ] 0 Warning(s)
[ ] 1 Error(s)
[ ] Time Elapsed 00:00:01.07
[ +22 ms] Building Windows application... (completed in 2.730ms)
[+1288 ms] Error: Build process failed.
[ ] "flutter run" took 6.892ms.
[ +25 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:815:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1389:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153: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:355:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:295:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:119:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
Expected behavior
No response
Generated binding code
No response
OS
Windows
Version of flutter_rust_bridge_codegen
2.0.0-dev.27
Flutter info
[√] Flutter (Channel stable, 3.19.3, on Microsoft Windows [Version 10.0.22631.3155], locale de-DE)
• Flutter version 3.19.3 on channel stable at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ba39319843 (16 hours ago), 2024-03-07 15:22:21 -0600
• Engine revision 2e4ba9c6fb
• Dart version 3.3.1
• DevTools version 2.31.1
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\thisi\AppData\Local\Android\sdk
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] 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.6.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.6.33815.320
• Windows 10 SDK version 10.0.22000.0
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[√] VS Code (version 1.86.2)
• VS Code at C:\Users\thisi\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.54.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3155]
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.227
• Edge (web) • edge • web-javascript • Microsoft Edge 121.0.2277.128
[√] Network resources
• All expected network resources are available.
! Doctor found issues in 2 categories.
Version of clang++
No response
Additional context
No response
Also, the flutter_via_create
example works for me for some reason, but the normal creation flow seems to break something.
[ +16 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build for
'C:\Users\thisi\OneDrive\Dokumente\We(e)b Stuff\liphium\chatapp\build\windows\x64\CMakeFiles\34d09327d0e9721e135c3ae11b70bac0\rust_lib_chatapp.dll.rule;C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\build\windows\x64\CMakeFiles\93546235075c2c518944ccf2435ad857\rust_lib_chatapp_cargokit.rule' exited with code 255. [C:\Users\thisi\OneDrive\Dokumente\We(e)b
Stuff\liphium\chatapp\build\windows\x64\plugins\rust_lib_chatapp\rust_lib_chatapp_cargokit.vcxproj]
Hi, it would be great to run flutter run --verbose
to see more logs. Usually this looks like a cargokit error (instead of flutter_rust_bridge core error).
The output I sent already uses flutter run --verbose
, it just doesn't print very much for some reason. Should I just go report this to CargoKit then?
A quick google for MSB8066
shows things like: https://stackoverflow.com/questions/67031371/flutter-windows-cannot-build-app-error-msb8066, flutter/flutter#133230, etc. Could you please check whether they are related? I am also not sure whether that is a cargokit error, or a general Flutter environment/configuration error.
I'm so sorry for this stupid issue wasting your time. Yes it is related, and I'll make sure to never put a space into my path ever again. Thanks for helping me here, though, you were a real life saver!
You are welcome and it's OK!