6
votes

Launching lib/main.dart on Android SDK built for x86 in debug mode...

[!] Gradle does not have execution permission. You should change the ownership of the project directory to your user, or move the project to a directory with execute permissions. Gradle task assembleDebug failed with exit code 1 Exited (sigterm)

4
I've been having this issue as well since last night... I have ownership of the project folder too. I ran chmod -R myusername . just to make sure. Also, it's only on one project i cloned from Github... Tensor's project, if that makes any difference - ThinkDigital
the command not working - MuZ.
Right. It doesn't fix the issue. That's what I was saying. - ThinkDigital
I have same issue while building flutter app in AppCenter - AVEbrahimi

4 Answers

59
votes

I got the same error trying to execute flutter run on a mac. Apparently, in your flutter project, there is a file android/gradlew that is expected to be executable (and it wasn't). So in my case, I ran...

chmod a+rx android/gradlew

...afterwards the flutter command worked.

1
votes

Try to set the execution flag on your gradlew file:

chmod +x gradlew
1
votes

FOR FLUTTER I have tried mostly everything mentioned here and on my own. The solution, actually, it is a series of solutions and worked for me, I am mentioning them try as you wish.

  1. Make sure no antivirus *firewall is blocking, gradle.bat, gradlew.bat, git, flutter, android studio

  2. Get the latest Gradle and install it to lower privilege directory, not in Program Files or Program Files (X86); I did it in D drive. Don't forget to update the path in Environment Variables.

  3. I also installed JAVA Runtime (JRE).

  4. Install git as it is necessary for flutter.

  5. You can Check-in windows command line after installing each (Git, Gradle and flutter doctor). if nothing seems to work Restart the pc after each.


  1. You might try it first, Disable the Gradle plugin and re-enable and restart android studio.

After this when you will compile /run the app it will take a long time please bear with that(at least 15 min just to be sure).


I had the app directory with Read, Write & Modifying permissions still, it was giving that error- Error code 1 "gradle does not have execution permission. you should change the ownership of the project directory to your user, or move the project to a directory with execute permissions."

so I think it is related to the connection with the plugin.

Hope it helped :-)

-2
votes
chmod a+rx android/gradlew

This works but for windows you need to install "Git for Windows"