Reputation: 29
"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:
Flutter doctor:
logcat:
device connected:
Upvotes: 2
Views: 1724
Reputation: 2864
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:
flutter create -t <project_name>
, by using this command, it will ensure that there will be gradlew.bat
file inside the project.<project_name>\android
, copy that gradlew.bat
file.<project_name>\android
) of one of your current not-working Flutter project.flutter run
command on that project.Upvotes: 0
Reputation: 1347
Flutter provides a command to update the Android SDK path:
Use flutter config --android-sdk <path-to-your-android-sdk-path>
Upvotes: 0
Reputation: 855
Open your android folder with the android studio it'll help you to find out whats the issue. also, check this answer too.
Upvotes: 3