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.

0
19 comments

Try using Java 8. In IntelliJ IDEA specify Java version used for Gradle here:

0
Avatar
Permanently deleted user

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.

 

0

Did you install this?

0
Avatar
Permanently deleted user

Yes, it's installed.

0
Avatar
Permanently deleted user

0

Maybe your project is linking non-existing version of the appcompat dependency?

0
Avatar
Permanently deleted user

I just created a brand new Android project and get this error:

 

0

Try clicking the link to install it again.

0
Avatar
Permanently deleted user

I was able to disable the plugin and that might fix it, thanks for the help.

0
Avatar
Permanently deleted user

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. 

 

0

This error is harmless.

0
Avatar
Permanently deleted user

Okay, thanks.

 

It keeps stating an error on the following line: 26, 13

 

0

Try reinstalling Android SDK from scratch.

0
Avatar
Permanently deleted user

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. 

0

You can make a new SDK installation in a separate directory and point IntelliJ IDEA to it.

0
Avatar
Permanently deleted user

Would you happen to know the steps required or have a link?  I couldn't figure it out.

0
Avatar
Permanently deleted user

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?

0

Use Android Studio 3.0 instead of IntelliJ IDEA.

0

Please sign in to leave a comment.