Why can't i run my flutter app in vs code terminal/cmd if my previous apps went on android studio? - flutter

When i type "flutter run" in folder of my app created in VS CODE or cmd i get this error:
Launching lib\main.dart on LG H870 in debug mode...
Target file "C:\Users\Kwiat\Documents\\Users\Kwiat\Documents\\Users\Kwiat\Documents\Projects\Flutter\kaka\kaka\build\app\intermediates\flutter\debug\android-arm64/flutter_assets" not found.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 765
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebugArm64'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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 2s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Why i haven't got flutter_assets file and Target file path is so weird? How to fix it to run my apps?

Ok, i just realised that flutter doesn't support foldernames with'!' in it. I tried to create project in folder without '!' and it worked.

Related

When I try to run the sample code app on the Android emulator to do flutter with vscode, I get an error

FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\inubo\Downloads\flutter_windows_3.3.7-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1165
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\inubo\Downloads\flutter_windows_3.3.7-stable\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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 5s
Exception: Gradle task assembleDebug failed with exit code 1
I tried to flutter with vscode to produce an app and it worked until setup, but when I finally try to debug the sample code app in the Android emulator, I get an error. Debugging with Edge and Chrome is successful.
flutter clean
flutter pub get
Remove pubspec.look
I tried, but these did not work.

Flutter debug error, FAILURE: Build failed with an exception

Why am I getting the following error? All of a sudden it started giving this error.
FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1
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
BU�LD FAILED in 1m 6s
Exception: Gradle task assembleDebug failed with exit code 1
Did you try deleting pubspec.lock file? If not, try it. Or try these steps
Go to pubspec.yaml file in android studio.
try doing “packages get”
and then build the project again.
or
follow this answer https://stackoverflow.com/a/66406390/16094734

Improperly formatted define flag: EDIT _ flutter

What is the issue below? Recently updated flutter, then got this error.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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 9s
Exception: Gradle task assembleDebug failed with exit code 1
You can also resolve this by shortening the path directory.
Copy the project folder/file and paste in the desktop or any shorter directory. Re-import the project into Android Studio or your IDE and debug and overwrite the existing project. It worked for me. Thanks.

Flutter Update issues

My flutter code works perfectly fine and I have run multiple tests on it.
I just decided to install the new VS code updates and restart my VS code application.
All of the sudden I started having the error below and I have searched the entire code for the method but none was found
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart
../../../flutter_windows_1.22.3-stable/flutter/packages/flutter/lib/src/widgets/navigator.dart:3783:32: Error: Getter not found: 'deoNotPop'.
case RoutePopDisposition.deoNotPop:
^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\temp\flutter_windows_1.22.3-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\temp\flutter_windows_1.22.3-stable\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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 1m 26s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Someone, please help me
It looks like you may have inadvertedly modified a Flutter SDK file:
flutter/packages/flutter/lib/src/widgets/navigator.dart
case RoutePopDisposition.deoNotPop:
This should say doNotPop and not doeNotPop. Removing the e and saving the file should fix it. You can run git status in your Flutter SDK to see if there are other changes that may need reverting.

Process 'command "flutter.bat'' finished with non-zero exit value 1 error

I have been battling with this issue since yesterday after I upgraded my flutter and I don't know what is causing this issue. I have searched it from Google but I don't seem to find any answer so I need help.
The location of my Flutter SDK and the error is below.
Script 'C:\Users\src\Music\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\src\Music\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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 1m 20s
Exception: Gradle task assembleDebug failed with exit code 1
I once had a similar issue. I just deleted flutter and reinstalled the newest version directly by downloading the stable zip file from https://flutter.dev/docs/get-started/install