Problems building new Android project using IntelliJ
Answered
Hi,
I'm running a mac and have the newest java 9 sdk installed on my computer. I can compile and create java programs without any problems but when I try and create a new Android project it gives me problems when I try and build the project.
I keep getting sync failed errors when I try to build and the error is: The supplied javaHome seems to be invalid. I cannot find the java executable.
I've tried to uninstall java and reinstall and change grade versions. Nothing seems to work, any help would be appreciated.

Please sign in to leave a comment.
Try using Java 8. In IntelliJ IDEA specify Java version used for Gradle here:
Thank you,
that fixed one problem but I seem to still be encountering errors. I ended up installing all android sdk's but that didn't seem to fix the new problem.
Did you install this?
Yes, it's installed.
Maybe your project is linking non-existing version of the appcompat dependency?
I just created a brand new Android project and get this error:
Try clicking the link to install it again.
I was able to disable the plugin and that might fix it, thanks for the help.
Hi, I've tried a quite a few things but I seem to be stuck on the problem below:
I can start the build process with all green circles but I encounter the following process.
This error is harmless.
Okay, thanks.
It keeps stating an error on the following line: 26, 13
Try reinstalling Android SDK from scratch.
Hi Serge,
I've tried re-installing the Android SDK but that didn't seem to fix the problem. one interesting thing I noticed when trying to reinstall the android SDK is the sdk manager seems to not be working correctly.
I do have android studio on my mac and I am wondering if it is conflicting somehow with IntelliJ? Can you please tell me the recommended method for reinstalling Android SDK from scratch?
I ended up having to go into Android Studio to try and uninstall and re-install the SDK.
Thanks.
You can make a new SDK installation in a separate directory and point IntelliJ IDEA to it.
Would you happen to know the steps required or have a link? I couldn't figure it out.
https://stackoverflow.com/a/45268592/104891 may help.
Hi Serge,
So I've completely removed all android sdk's and installed a newer version of IntelliJ with a December build and removed Android Studio.
Currently I can't install the android sdk required by IntelliJ to create an android project using the sdkmanager,
that is doesn't seem to be working correctly.
when I type the following command:
$sdkmanager platforms;android-26
Warning: Failed to find package platforms
-bash: android-26: command not found ] 10% Computing updates...
and that's all that happens. I've tried different packages, it seems like the command line tool broken?
Use Android Studio 3.0 instead of IntelliJ IDEA.