0
votes

I´m facing a weired error when I try to execute my gradle script from PHP, which works fine when I execute it directly from the shell.

The project folder has permissions 777 recursively and the www-data user is in the group of root user

:app:preBuild FAILED

 BUILD FAILED

And this is the output from running with --debug

http://pastebin.com/diDD0ddG

(Sadly SO think it is source code and won´t let me post it here as a quote)

All solutions I´ve found are saying that the gradle version in the build script may be wrong, but as I said, it works perfectly when I start it directly from the shell.

Does anyone have suggestions how to solve it?

1
when error do you get. please run your build with s to get a stacktrace / error message - Rene Groeschke
sadly there is no more output when running with --s, but with --d I´m getting a bit more which seems to be not useful at all. I add it to the post - Marian Klühspies
now I´ve created a python script which calls gradle, but it behaves the same like a direct call. shell works, php not - Marian Klühspies

1 Answers

0
votes

Okay let me answer my own question:

After reading the /var/log/apache2/error.log file where it says

failed to find target android-20 : /opt/android-sdk/sdk

I´ve changed the ownership of the sdk folder with

chown -R www-data:www-data sdk/

And now everything works fine