1

I've problem with build my Android project from IntelliJ. I set up default Android project and try to compile, then:

Error: Gradle: Execution failed for task ':app:preDexDebug'.

(...)

/android-sdk/sdk/build-tools/android-4.4W/dx: line 89: exec: java: not found

I use gradle wrapper from ide. I have java on the PATH, and JAVA_HOME properly. So what is the reason of error?

2 Answers 2

1

I've solved my problem.

I've set my java on the path in .bashrc file. Probably dx runs from shell without read that file, so I set that in '/etc/profile' and it works.

Sign up to request clarification or add additional context in comments.

Comments

0

Your using android. So you selected the Android API in "Project SDK" in File > Project Structure, and when you click on edit next to the android api, there is a java jdk selected? Your build.gradle file should also contain

apply-plugin: 'android' 

and your sourcedir must be set in sourcesets in your build.gradle:

srcDir 'src/java' 

more info about getting started with gradle build-files can you find here: http://tools.android.com/tech-docs/new-build-system/user-guide

1 Comment

Of course, I have choosen one, the same as on the PATH

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.