I have installed flutter and Visual studio code and followed all the steps. I created a new flutter project and tried running it. However, it does not run either in the phone and will not launch the browser either.
Here is the output when the project is created:
[flutter_application_1] flutter create –template app –overwrite .
Creating project …. Resolving dependencies… Got dependencies.
Wrote 129 files.All done! You can find general documentation for Flutter at:
https://docs.flutter.dev/ Detailed API documentation is available at:
https://api.flutter.dev/ If you prefer video documentation, consider:
https://www.youtube.com/c/flutterdevIn order to run your application, type:
$ cd . $ flutter run
Your application code is in .libmain.dart.
exit code 3221225501
Here is the output when trying to launch on the phone.
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ‘:app:compileFlutterBuildDebug’.
Process ‘command ‘F:fbinflutter.bat” finished with non-zero exit value -1073741795
- Try:
Run with –stacktrace option to get the stack trace.
Run with –info or –debug option to get more log output.
Run with –scan to get full insights.
- Get more help at https://help.gradle.org
BUILD FAILED in 48s Running Gradle task ‘assembleDebug’…
And this is what happens when I try to run it in a browser and it will not launch the browser:
flutter run -d Chrome Launching libmain.dart on Chrome in debug
mode… Waiting for connection from debug service on Chrome…
PS: I have tried out using Android Studio as well. It did not work there as well. On Android Studio I get a project creation error. Have asked about it here. However, If i restart android studio it does run the web app but with regards to the android App I get the same error as above.
Here is the output for flutter doctor -v
[√] Flutter (Channel stable, 3.19.2, on Microsoft Windows [Version
10.0.19045.4046], locale en-IN)
• Flutter version 3.19.2 on channel stable at F:f
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7482962148 (11 days ago), 2024-02-27 16:51:22 -0500
• Engine revision 04817c99c9
• Dart version 3.3.0
• 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 34.0.0)
• Android SDK at F:androidsdk
• Platform android-34, build-tools 34.0.0
• Java binary at: F:Androidandroid studiojbrbinjava
• 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 FilesGoogleChromeApplicationchrome.exe
[X] Visual Studio - develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2023.1)
• Android Studio at F:Androidandroid 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 17.0.7+0-b2043.56-10550314)
[√] VS Code (version 1.87.1)
• VS Code at C:UserschaitanyaAppDataLocalProgramsMicrosoft VS Code
• Flutter extension version 3.84.0
[√] Connected device (4 available)
• moto g32 (mobile) • 192.168.29.6:43373 • android-arm64 • Android 13 (API 33)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.4046]
• Chrome (web) • chrome • web-javascript • Google Chrome 122.0.6261.95
• Edge (web) • edge • web-javascript • Microsoft Edge 122.0.2365.66
[√] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
2
Answers
So here is the thing if you have the same problem... It did not work for me on windows... I went on to ubuntu and it works there.
Try
flutter doctor
See if any of the requirement is not completed.
Check if emulator is installed correctly.
Also, do
flutter upgrade
If there is any improvement. Tell us.
Found this in stack here