Error in running flutter project which no permission

11,265

Solution 1

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.

Solution 2

Try to set the execution flag on your gradlew file:

chmod +x gradlew

Solution 3

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

Share:
11,265
MuZ.
Author by

MuZ.

Updated on December 15, 2022

Comments

  • MuZ.
    MuZ. over 1 year

    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)