Home > Software design >  Flutter Exception: Gradle task assembleDebug failed with exit code 1. when hotspot is on
Flutter Exception: Gradle task assembleDebug failed with exit code 1. when hotspot is on

Time:06-20

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?

CodePudding user response:

I resolved my issue when I updated gradle in my flutter project by:

  1. Create a new temp project with the latest version of Flutter.
  2. 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
  1. 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