[Flutter Error]-Execution failed for task ':app:compileFlutterBuildDebug' - flutter

I recently formatted my pc and upgraded to windows 11.When I try to run my flutter app on my mobile phone,I get this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Failed to create parent directory 'C:\Users\HP' when creating directory
'C:\Users\HP\Desktop\OWASLO\care_receiver_app\ss_carereceiver_app\android\app\build\intermed iates\flutter\debug\flutter_assets'
* 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 56s
Exception: Gradle task assembleDebug failed with exit code 1
the path mentioned in the error log
C:\Users\HP\Desktop\OWASLO\care_receiver_app\ss_carereceiver_app\android\app\build\intermed
iates\flutter\debug\flutter_assets
is where my app was before I formatted and
"C:\Users\HP"
was the user name before the laptop was formatted.
The app works fine on chrome but wont work on mobile.
Please help!!!

Related

build apk working in flutter but run in emulator dose not work

i download flutter yesterday and make a project by flutter create command
i had problem in the build and run at first but i follow the instructions of https://docs.flutter.dev/deployment/android
then i build the app and try it in my phone and it work
but when i try to run the app in my phone by usb or in the emulator the same error happend
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:validateSigningDebug'.
java.util.concurrent.ExecutionException: com.android.builder.utils.SynchronizedFile$ActionExecutionException: java.io.IOException: com.android.ide.common.signing.KeytoolException: Failed to create keystore.
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 6s
Exception: Gradle task assembleDebug failed with exit code 1
i tried the solve of the website above

I deleted some of my files in my C-drive after that my flutter project is not running and showing this exception

FAILURE: Build failed with an exception.
Where:
Settings file 'C:\Users\hassa\development\GIFT-Transport-Management-System\gtms\android\settings.gradle' line: 11
What went wrong:
A problem occurred evaluating settings 'android'.
Failed to deserialize script metadata extracted for script 'C:\flutter\flutter\packages\flutter_tools\gradle\app_plugin_loader.gradle'
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 4s
Exception: Gradle task assembleDebug failed with exit code 1
I tried to delete some of the files.

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.

Execution failed for task ':unityExport:BuildIl2CppTask'. Flutter and Unity

I'm trying to implement a basic 3D scene of Unity into a Flutter App.
I keep having this error and I have no clue what it means.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\~~~~\~~~~\FlutterProject\unityv1\android\unityExport\build.gradle'
line: 55
* What went wrong:
Execution failed for task ':unityExport:BuildIl2CppTask'.
> Process command
C:/~~~~/~~~~/FlutterProject/unityv1/android/unityExport/src/main/Il2CppOutputProject/IL2CP
P/build/deploy/netcoreapp3.1/il2cpp.exe finished with non-zero exit value 4
* 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 36s
Exception: Gradle task assembleDebug failed with exit code 1
I have the latest version of Flutter and Unity.
If you have an hint please tell me, thanks!

Execution failed for task ':app:compileDebugJavaWithJavac'. flutter

my project was going great till i ran flutter clean and then tried to run my app on android,where i got this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
* 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 20s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
This issue will most likely occur when the dependencies of your app is not compatible with your development environment.
On the following SO posts, the best solution for this error is to update the dependencies as also mentioned in the comment above. To backup the references, you can refer to this SO post that exhibits the issues encountered:
Flutter error: Execution failed for task ':app:compileDebugJavaWithJavac'
Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio