Flutter Exception: Gradle task assembleDebug failed with exit code 1. when hotspot is on - flutter

An error appears when I run my flutter app with hotspot on:
FAILURE: Build failed with an exception.
* What went wrong:
The first result from the daemon was empty. Most likely the process died immediately
after connection.
* 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
Exception: Gradle task assembleDebug failed with exit code 1
I need the hotspot because I want to run the app on physical device using pair wifi to connect to the same wireless network.
What's wrong?

I resolved my issue when I updated gradle in my flutter project by:
Create a new temp project with the latest version of Flutter.
In the temp project open android/gradle/wrapper/gradle-wrapper.properties and check the distributionUrl. Update your old project to use the same one.
For me today the distributionUrl looks like this:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
Rerun your app. It has to download the new version of gradle to the android/.gradle directory so the first time might take a while.

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

erron on vscode gradle

i have one error that's is impossible for me to solve, what kind of problem is this shit?
I've searched for many ways to fix this but i don't have found it nothing for this problem on vscode only for android studio, someone can help me?
enter image description here
this impossibilite me to deploy my application in a on virtual android always stop in this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
> Resource compilation failed. Check logs for details.
* 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
Exited (sigterm)
You should run
flutter run --verbose
and try to upload new image error.
I've found it whats happening man,in flutter in pub dev they gave changed the ways of splash screen it's not using the drawables anymore,we must create in lib paste the archive called Splash-Screen.dart and code all the splash screen rsrsrs but i'll appreciate your bro,and i'm very thankfull for that.

How to solve this Error ::: File google-services.json is missing. The Google Services Plugin cannot function without it

enter image description hereError only while testing on phone device ,, Working fine in browser.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/Users/mb/Js/untitled/android/app/src/debug/google-services.json
/Users/mb/Js/untitled/android/app/src/google-services.json
/Users/mb/Js/untitled/android/app/src/Debug/google-services.json
/Users/mb/Js/untitled/android/app/google-services.json
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 8s
Exception: Gradle task assembleDebug failed with exit code 1
[![enter image description here](https://i.stack.imgur.com/1nXzY.png)](https://i.stack.imgur.com/1nXzY.png)
Switch into the android directory and first call ./gradlew clean. This gets the android project in flutter to a brand new state. Then go back to your flutter directory and call flutterfire configure. This will register your app with the firebase console and sync down all your application keys. Once this is done, you should be able to build like normal. On the first compilation of your app, it will generate a google-services.json file from the API keys within the flutter project.

Build failed on Mac OS not in Windows Flutter

I just moved to a Mac device, and a flutter project that can run on Windows 10, but when I try to go on the Macbook,
the debug console displays an error like this, please help, thank you.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> java.net.URISyntaxException: Illegal character in opaque part at index 2: G:\\2. KoffieSoft\\Referensi\\fix\\Operasional\\mjw_operasional\\android\\app\\build\\intermediates\\flutter\\debug\\flutter_assets\\AssetManifest.json
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
Exited (sigterm)
2. KoffieSoft -> This is okey for windows but problem on mac. Do not use space char on your folder names. You can use _ like 2_KoffieSoft
Thank you sir, I have found the solution. the solution I look for a file named G:\2. KoffieSoft\Reference\fix\Operational\mjw_operational\android\app\build\intermediates\flutter\debug\flutter_assets\AssetManifest.json in the android file after that I deleted the file and I flutter clean => flutter pub get => run, the error no longer appears and my project can be run on a mac,

Could not resolve all artifacts for configuration ':app:debugCompileClasspath'

After the flutter 1.17 update, I tried to run my app, but it shows this error. flutter doctor command works fine. I don't understand what is happening
Launching lib\main.dart on Redmi Note 7 Pro in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
> Could not download arm64_v8a_debug.jar (io.flutter:arm64_v8a_debug:1.0.0-540786dd51f112885a89792d678296b95e6622e5)
> Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-540786dd51f112885a89792d678296b95e6622e5/arm64_v8a_debug-1.0.0-540786dd51f112885a89792d678296b95e6622e5.jar'.
> Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-540786dd51f112885a89792d678296b95e6622e5/arm64_v8a_debug-1.0.0-540786dd51f112885a89792d678296b95e6622e5.jar'.
> Remote host closed connection during handshake
* 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 12s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I met with a similar problem of unavailability of kotlin sdk resources. Couldn't find a quick solution, but the problem was most likely on the server side with resources. Because the next morning, the whole assembly was successful.
Perhaps you should just wait, if before that everything was going fine and suddenly stopped.
After reading the entire branch, I still did not find a solution for my case, but it may be useful to someone.
https://github.com/flutter/flutter/issues/23553
I had a similar issue and it was resolved when I changed the following settings in my build.gradle file:
ext.kotlin_version = '1.3.61' //from 1.3.50
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3' //from 3.5.0
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}