Flutter project no longer building for windows - windows

Not sure what's caused it but for some reason my windows application no longer builds.
The error output is the following:
[ +60 ms] C:\Users\George\source\repos\ReactionTracking\src\ReactionTrackerClient\windows\runner\Runner.rc(125): error RC2135: file not found: + [C:\Users\George\source\repos\ReactionTracking\src\ReactionTrackerClient\build\windows\runner\reactions.vcxproj]
[ +1 ms] C:\Users\George\source\repos\ReactionTracking\src\ReactionTrackerClient\windows\runner\Runner.rc(129): error RC2135: file not found: + [C:\Users\George\source\repos\ReactionTracking\src\ReactionTrackerClient\build\windows\runner\reactions.vcxproj]
When I ctrl + click the path directly in VS Code terminal it opens the file fine, so I know the path is valid and the file exists.
Did some research and the closest to my issue I could find was an issue with spaces and special characters in the path, which I have removed as above.
I have deleted the pubspec.lock, tried moving the project into a different folder, running the build command in a terminal running as admin. It was working fine until recently. Wondering if anyone has had any similar issues recently and what they did to fix it?
EDIT
Here is my flutter doctor -v output
[✓] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.22000.675], locale en-AU)
• Flutter version 2.10.5 at C:\Users\George\source\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5464c5bac7 (7 weeks ago), 2022-04-18 09:55:37 -0700
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
• Android SDK at E:\AppData\Android
• Platform android-32, build-tools 33.0.0-rc1
• ANDROID_HOME = E:\AppData\Android
• ANDROID_SDK_ROOT = E:\AppData\Android
• Java binary at: E:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.6)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.1.32421.90
• Windows 10 SDK version 10.0.20348.0
[✓] Android Studio (version 3.6)
• Android Studio at E:\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 1.8.0_212-release-1586-b04)
[✓] VS Code (version 1.67.2)
• VS Code at C:\Users\George\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.42.0
[✓] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.675]
• Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.127
• Edge (web) • edge • web-javascript • Microsoft Edge 101.0.1210.53
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!

Solved by:
Removing windows folder.
Recreate it using flutter create . Repairs and adds the missing files.

If anyone stumbles onto this with the same issue. Still don't know the cause but removing and re-adding windows as a platform sorted it out.

Related

Flutter and Windows, several problems from 'No implementation..' to 'Failed to remove build', ending with 'Build process failed.'

I'm building a WebRTC client with Flutter on Windows.
I have had this problem MissingPluginException (MissingPluginException(No implementation found for method startRecordToFile on channel FlutterWebRTC.Method)) traying record a stream.
For the one to solve it, it told me to register Dart Plugins with DartPluginRegistrant.ensureInitialized();, which did not work.
So I updated the plugins.
flutter pub outdated
flutter pub upgrade --major-versions
and same results.
So when trying to go back to previous versions it doesn't even let me compile.
flutter pub cache repair
flutter pub get
flutter build windows
I also tried flutter pub cache clean, and
flutter clean gave me this result:
PS C:\Users\santi\dev\IKUZAIN\fwrtc_win> flutter clean
Failed to remove build. A program may still be using a file in the directory or the directory itself. To find and stop such a program, see:
https://superuser.com/questions/1333118/cant-delete-empty-folder-because-it-is-used
Deleting build... 201ms
Deleting .dart_tool... 7ms
Deleting Generated.xcconfig... 1ms
Deleting flutter_export_environment.sh... 0ms
Deleting ephemeral... 21ms
Deleting .flutter-plugins-dependencies... 0ms
Deleting .flutter-plugins... 1ms
I even restarted the computer.
With that result I can't continue compiling...
PS C:\Users\santi\dev\IKUZAIN\fwrtc_win> flutter build windows
Building with sound null safety
/C:/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.8.12/lib/src/native/rtc_video_renderer_impl.dart(11,7): error G76B49859: The non-abstract
class 'RTCVideoRenderer' is missing implementations for these members: [C:\Users\santi\dev\IKUZAIN\fwrtc_win\build\windows\flutter\flutter_assemble.vcxproj]
/C:/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.8.12/lib/src/media_recorder.dart(18,8): error GE5CFE876: The method 'MediaRecorder.startWeb' has fewer named arguments than those of overridden method 'MediaRecorder.startWeb'. [C:\Users\santi\dev\IKUZAIN\fwrtc_win\build\windows\flutter\flutter_assemble.vcxproj]
/C:/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.8.12/lib/src/native/media_recorder_impl.dart(30,8): error GE5CFE876: The method 'MediaRecorderNative.startWeb' has fewer named arguments than those of overridden method 'MediaRecorder.startWeb'. [C:\Users\santi\dev\IKUZAIN\fwrtc_win\build\windows\flutter\flutter_assemble.vcxproj]
/C:/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.8.12/lib/src/native/media_stream_impl.dart(103,15): error G0A556F40: The return type of the method 'MediaStreamNative.clone' is 'MediaStream', which does not match the return type, 'Future<MediaStream>', of the overridden method, 'MediaStream.clone'. [C:\Users\santi\dev\IKUZAIN\fwrtc_win\build\windows\flutter\flutter_assemble.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Compilaci�n personalizada de "C:\Users\santi\dev\IKUZAIN\fwrtc_win\build\windows\CMakeFiles\7e012dc9275095dffd41e5dc17eebab0\flutter_windows.dll.rule;C:\Users\santi\dev\IKUZAIN\fwrtc_win\build\windows\CMakeFiles\e7e364d593aab9909a7dd61f45347876\flutter_assemble.rule" terminada con el c�digo 1. [C:\Users\santi\dev\IKUZAIN\fwrtc_win\build\windows\flutter\flutter_assemble.vcxproj]
Building Windows application...
Build process failed.
I have no problem with flutter doctor -v
[✓] Flutter (Channel stable, 3.3.3, on Microsoft Windows [Versi¢n 10.0.19044.2251], locale es-ES)
• Flutter version 3.3.3 on channel stable at C:\sdk\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18a827f393 (8 weeks ago), 2022-09-28 10:03:14 -0700
• Engine revision 5c984c26eb
• Dart version 2.18.2
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\santi\AppData\Local\Android\sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
• 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.4.1)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.4.33110.190
• Windows 10 SDK version 10.0.19041.0
[✓] Android Studio (version 2021.2)
• 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.12+7-b1504.28-7817840)
[✓] VS Code (version 1.73.1)
• VS Code at C:\Users\santi\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.52.0
[✓] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Versi¢n 10.0.19044.2251]
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.108
• Edge (web) • edge • web-javascript • Microsoft Edge 107.0.1418.56
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Any idea?
Thanks
I'm not sure what packages are you using for this project.
May be you should check whether the packages using for the project support Windows platform

Can not run flutter windows application [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 months ago.
Improve this question
I am getting this error while running the flutter application targeting windows. The project is running on android and the web.
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
Exception: Unable to generate build files
And in the console
flutter doctor -v
After running flutter doctor,
C:\Users\ibrahim42386>flutter doctor -v
[√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [Version 10.0.22616.100], locale en-US)
• Flutter version 3.3.4 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision eb6d86ee27 (6 days ago), 2022-10-04 22:31:45 -0700
• Engine revision c08d7d5efc
• Dart version 2.18.2
• DevTools version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\ibrahim42386\AppData\Local\Android\Sdk
• Platform android-32, build-tools 31.0.0
• ANDROID_HOME = C:\Users\ibrahim42386\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\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:\Users\ibrahim42386\AppData\Local\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.5)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.3.32922.545
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.3)
• 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.13+0-b1751.21-8125866)
[√] VS Code (version 1.71.2)
• VS Code at C:\Users\ibrahim42386\AppData\Local\Programs\Microsoft
VS Code
• Flutter extension version 3.50.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22616.100]
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.77
• Edge (web) • edge • web-javascript • Microsoft Edge 105.0.1343.33
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
What should I do to run this project on windows?

Flutter-Folio: Building Windows application... Exception: Build process failed. error G69E91ED9, error MSB8066

I cloned the repo and Installed Visual Studio and all the necessary tools as stated on the flutter website for windows applications. I have been using flutter for a while now so I have Visual Studio Code installed and configured for flutter. But when I run "flutter run -d windows" I get the error which says:
/D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/visibility_detector-0.2.0/lib/src/visibility_detector_layer.dart(276,21): error G69E91ED9: Too many positional arguments: 1 allowed, but 2 found. [C:\Users\GTL-DAN-002\Documents\Projects\Flutter\flutter-folio\build\windows\flutter\flutter_assemble.vcxproj]
D:\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(242,5): error MSB8066: Custom build for 'C:\Users\GTL-DAN-002\Documents\Projects\Flutter\flutter-folio\build\windows\CMakeFiles\3350ef37c8b8b08ac8c1be72abc20593\flutter_windows.dll.rule;C:\Users\GTL-DAN-002\Documents\Projects\Flutter\flutter-folio\build\windows\CMakeFiles\c9ea6ec0dd188632dc4dfb02305c9fe9\flutter_assemble.rule' exited with code 1. [C:\Users\GTL-DAN-002\Documents\Projects\Flutter\flutter-folio\build\windows\flutter\flutter_assemble.vcxproj]
Below is the output of flutter doctor -v
flutter doctor -v
[√] Flutter (Channel dev, 2.9.0-0.1.pre, on Microsoft Windows [Version 10.0.22000.376], locale en-US)
• Flutter version 2.9.0-0.1.pre at D:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 8f1f9c10f0 (3 weeks ago), 2021-12-14 13:41:48 -0800
• Engine revision 234aca678a
• Dart version 2.16.0 (build 2.16.0-80.1.beta)
• DevTools version 2.9.1
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\GTL-DAN-002\AppData\Local\Android\sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• 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.0.4)
• Visual Studio at D:\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.0.32014.148
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• 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.10+0-b96-7249189)
[√] VS Code (version 1.63.2)
• VS Code at C:\Users\GTL-DAN-002\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.32.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.376]
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.110
• Edge (web) • edge • web-javascript • Microsoft Edge 96.0.1054.62
! Device 04669259A7007526 is not authorized.
You might need to check your device for an authorization dialog.
• No issues found!

Stuck at Flutter project run in Visual Studio

[flutter] flutter.bat doctor -v
[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18363.778], locale en-GB)
• Flutter version 1.12.13+hotfix.9 at D:\flutter\flutter
• Framework revision f139b11009 (5 weeks ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\vrind\AppData\Local\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = C:\Users\vrind\AppData\Local\Android\Sdk
X Android SDK file not found: C:\Users\vrind\AppData\Local\Android\Sdk\platforms\android-28\android.jar.
• Try re-installing or updating your Android SDK,
visit https://flutter.dev/setup/#android-setup for detailed instructions.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] VS Code (version 1.44.2)
• VS Code at C:\Users\vrind\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.10.1
[√] VS Code, 64-bit edition (version 1.26.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.10.1
[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
! Doctor found issues in 1 category.
exit code 0
check you ANDROID_HOME path in environment variable. if not exist then create a path with name ANDROID_HOME and set the android sdk location to the path. if exist then check the location.
I met this error, turn out I didn't add ANDROID_HOME path in the environment variable. You may want to check it again

Error while compile Flutter example project Gradle Zip?

i create flutter project with "Flutter create myapp" and "cd myapp", and the next i'll try run Flutter Run, but my output is:
I have a current stable version of Flutter and the recent sdk Android Q published.
This is my flutter doctor -v:
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [versão 10.0.18363.657], locale pt-BR)
• Flutter version 1.12.13+hotfix.8 at C:\src\flutter
• Framework revision 0b8abb4724 (18 hours ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\lucas\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.42.0)
• VS Code at C:\Users\lucas\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.8.1
[√] Connected device (1 available)
• SM J610G • 061f9b46 • android-arm • Android 9 (API 28)
• No issues found!

Resources