2

"Finished with error: Gradle task assembleDebug failed with exit code -1"

I make a new basic flutter project, and I got this error when I run flutter doctor everything is well, no issues detected. I have tried flutter clean, and try to rebuild and the messages are the same. anyone can help me please to fix this problem.

error:

enter image description here

Flutter doctor:

enter image description here

logcat:

enter image description here

device connected:

enter image description here

Module Window: enter image description here

7
  • first of all please open android module in Android studio and then run app it shows some relative error in logcat Commented Apr 16, 2020 at 5:25
  • i already updated logcat pict. Commented Apr 16, 2020 at 5:31
  • image does not contains any emulator information and real device so please first connect with real device or emulator then update the pic Commented Apr 16, 2020 at 5:33
  • my phone is connected, but in logcat showing "no connected device".. i updated picture Commented Apr 16, 2020 at 5:43
  • I am talking about Logcat window of Android Studio Commented Apr 16, 2020 at 5:45

3 Answers 3

3

Open your android folder with the android studio it'll help you to find out whats the issue. also, check this answer too.

Sign up to request clarification or add additional context in comments.

1 Comment

can you tell me the steps?
0

Flutter provides a command to update the Android SDK path:

Use flutter config --android-sdk <path-to-your-android-sdk-path>

4 Comments

i already do this and still error :( do you know how to uninstall without any setting saved? i want to try reinstall maybe can solved this problem
all. flutter and android studio, include android sdk and flutter sdk
please check new pict.
Which OS is there on your system?
0

I got same error code a few days ago when I try to run all my Flutter projects. To make sure you encounter the same problem as I did;

First, go to your project directory -> open android folder -> check if there's a gradlew.bat file inside. <project_name>\android\gradlew.bat. If there's no such file, then you can follow along.

Here's what I did:

  1. Run flutter create -t <project_name>, by using this command, it will ensure that there will be gradlew.bat file inside the project.
  2. Go to that project directory <project_name>\android, copy that gradlew.bat file.
  3. Paste it to the same directory path (<project_name>\android) of one of your current not-working Flutter project.
  4. Try to run the flutter run command on that project.

2 Comments

Hope that works for you. I tried some other things before doing that steps but I don't think they are relevant. Later if you've tried above steps and still doesn't work, I will edit my answer to provide all things I tried.
Ok i will try it

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.