DevenTW
DevenTW

Reputation: 81

Error in running flutter project which no permission

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)

Upvotes: 8

Views: 15690

Answers (5)

Franco
Franco

Reputation: 11

I had the same issue (Arch Linux), for some reason permissions where wrong in the flutter path:

sudo chown -R $(whoami) /opt/flutter/packages/flutter_tools/

Upvotes: 1

Neail
Neail

Reputation: 155

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 :-)

Upvotes: 2

Nehal
Nehal

Reputation: 1489

chmod a+rx android/gradlew

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

Upvotes: -3

Ulagapandi UPMS
Ulagapandi UPMS

Reputation: 123

Try to set the execution flag on your gradlew file:

chmod +x gradlew

Upvotes: 1

J. Brazile
J. Brazile

Reputation: 781

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.

Upvotes: 60

Related Questions