rive-flutter icon indicating copy to clipboard operation
rive-flutter copied to clipboard

Build fails on Windows

Open machiato32 opened this issue 1 year ago • 6 comments

Description

When building for windows with version 0.10.3 build fails:

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(440,5): error MSB8020: The build tools for ClangCL (Platform Toolset = 'ClangCL') cannot be found. To build using the ClangCL build tools, please install ClangCL build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\sszajbely\FlutterProjects\lender_app\build\windows\plugins\rive_common\rive_common_plugin.vcxproj]

Steps To Reproduce

  1. Run flutter run windows
  2. See the error

Device & Versions

Flutter doctor output:

[√] Flutter (Channel stable, 3.7.10, on Microsoft Windows [Version 10.0.22621.1413], locale hu-HU) • Flutter version 3.7.10 on channel stable at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4b12645012 (5 days ago), 2023-04-03 17:46:48 -0700 • Engine revision ec975089ac • Dart version 2.19.6 • DevTools version 2.20.1

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

[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) • Android SDK at C:\Users\sszajbely\AppData\Local\Android\sdk • Platform android-33, build-tools 32.1.0-rc1 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619) • All Android licenses accepted.

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

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.3) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.2.32526.322 • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.1) • Android Studio at C:\Program Files\Android\Android Studio • 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.15+0-b2043.56-9505619)

[√] VS Code, 64-bit edition (version 1.76.0) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.62.0

[√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.1413] • Chrome (web) • chrome • web-javascript • Google Chrome 111.0.5563.147 • Edge (web) • edge • web-javascript • Microsoft Edge 111.0.1661.62

[√] HTTP Host Availability • All required HTTP hosts are available

• No issues found!

Additional context

The build doesn't fail on rive version 0.9.1

machiato32 avatar Apr 09 '23 11:04 machiato32

Hi @machiato32 Clang is required to build for Windows, see our platform considerations doc.

This issue may also be helpful: https://github.com/rive-app/rive-flutter/issues/279#issuecomment-1370748762

HayesGordon avatar Apr 13 '23 09:04 HayesGordon

Hi @HayesGordon, so this wasn't the case for version 0.9.1, right? I looked at the changelog on pub.dev before posting this and nothing regarding Windows was on there. Sorry if this is a duplicate then.

machiato32 avatar Apr 13 '23 09:04 machiato32

It may be that you did have Clang installed, but you now require a later version. I believe there is a version of it that comes built within Windows - but not too sure about that.

For fun you can check to see, before installing anything:

clang --version

But yeah, I think if you update to the latest it should work! Let me know and I'll close this.

HayesGordon avatar Apr 13 '23 09:04 HayesGordon

clang --version outputs:

clang version 16.0.1
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin

Yet still outputs the same error

error MSB8020: The build tools for ClangCL (Platform Toolset = 'ClangCL') cannot be found. To build using the ClangCL build tools, please install ClangCL build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".

Visual Studio didn't work so I installed from LLVM-16.0.1-win64.exe

Do I need to modify anything else? Is it okay to open flutter windows folder in visual studio it seems to generate lot of boiler plate code

explorer-source avatar Apr 16 '23 15:04 explorer-source

@machiato32 did you manage to solve the problem? I have this issue with codemagic build now

AndreiMisiukevich avatar Mar 16 '24 02:03 AndreiMisiukevich

This happens on codemagic side. Should they do anything to support the latest rive version?

AndreiMisiukevich avatar Mar 16 '24 03:03 AndreiMisiukevich