4

I have installed android 2.2 in ubuntu 14.04 LTS but when I try to run an android app it shows immediate error: "Gradle sync failed: Cause: error=13, Permission denied. Consult IDE log for more details (Help | Show Log)".

When I looked into the terminal while I tried to run the android app, it gives below message in terminal: WARN - roid.tools.ndk.GradleWorkspace - NDK support for project 'MyApp' is disabled because the project doesn't contain any valid native configurations.

I have tried every possible solution on google/stackoverflow but nothing was helpful. Any help/suggestion would be appreciated. Thanks.

shark20
  • 41
  • 1
  • 3

4 Answers4

6

This error is sometimes generated due to Java JRE(built-in) failing to execute. Please try the following:

chmod +x android-studio/jre/bin/*
lamino
  • 132
  • 1
  • 9
2

To solve the first problem, did you try to execute the Android Studio as root or using sudo command?

To solve the warn, are you going to use the NDK (Native Development Kit) in your app? If yes, you have installed the NDK? If no, just ignore the warn.

To install the NDK you have to go to File -> Other Settings -> Default Project Structure And in the Android NDK Location, click in Download and then continue the installation.

  • Yes I have tried executing Android Studio as root and using sudo command as well but I am getting the same error. No, I don't need NDK so I will just ignore the warning. – shark20 Sep 30 '16 at 23:56
  • Sorry to insist, but did you log in as root in your system or just did it through the shell? I'm asking this because the Graddle sync could be executed by a daemon/service with normal user privilegies if you log in your system as a normal user. – Martin Buron Oct 01 '16 at 03:49
  • Yes, for the first time I logged in as normal user, and executed _./studio.sh_ , later on realised that I should have logged in as root and hence I am re-executing _./studio.sh_ with root privileges (i.e logged in as root) but still the issue persist. Is it because what I did in the first time execution? – shark20 Oct 01 '16 at 04:13
  • In this link http://stackoverflow.com/questions/17668265/gradlew-permission-denied say something about the gradle deamon (gradelw). The permission problem is solved using: chmod +x gradlew – Martin Buron Oct 01 '16 at 11:18
  • Voila! Worked like a charm. Thank you, saved my day. – shark20 Oct 01 '16 at 17:43
  • You're welcome. Now will repost the answer si you can give me the vote ;) – Martin Buron Oct 02 '16 at 19:47
  • Why should one ever have to run a development IDE as root? This shouldn't be required. Isn't changing the privileges on the JRE and gradlew a much more secure approach to solving this? – user2037235 Mar 14 '17 at 17:50
2

This may happen when your JRE(JDK) files are failing to execute due to no permission. So go to bin folder under your java folder location and make all files executable.

chmod +x /opt/java/java1.8.0_111/bin/*

If you are using built in JRE

chmod +x android-studio/jre/bin/*

I hope this helps.

Jote
  • 76
  • 8
0

The permission problem is solved using command 'chmod +x gradlew'. For more explanation refer this link

Community
  • 1
  • 1