Search Unity

Can not compile Android with 5.6.0xf3 due to Java7 JDK missing

Discussion in 'Linux' started by Reizla, Oct 29, 2017.

  1. Reizla

    Reizla

    Joined:
    Nov 5, 2013
    Posts:
    136
    I keep getting the build failure pop-up "Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. See the Console for details." and when checking the console I have the following errors:

    and

    I have the Java8 JDK installed (had it for Windows as well), but I read in the 5.6.0xf3 list that Java7 JDK is required. Problem though that this one is no longer supported and I have no clue where to get it (safely - not from a generic download site), or why Unity is even using this relic.

    Any help is more than welcome! I don't want to boot that Windows partition I still have on my system just to compile ;-)
     
  2. nat42

    nat42

    Joined:
    Jun 10, 2017
    Posts:
    353
  3. wenderRondonia

    wenderRondonia

    Joined:
    Mar 15, 2015
    Posts:
    29
  4. Reizla

    Reizla

    Joined:
    Nov 5, 2013
    Posts:
    136
    I've found that link already, but it's much like Windows XP support - gotta pay to get it :(

    I've been playing around a bit, and have the Java9 JDK installed now along with Unity 5.6.3xf1. This seems to have fixed the JDK problem, but now it has started nagging me about the Android SDK being a problem:

    I have taken a closer peek into the Linux Android SDK and it seems that a lot of Google APIs per API level are not installed. Not sure if this might be the problem, but I'm downloading a lot of those hoping that this will solve the problem.
    Alternatively, I have tested my code on my (almost dead) Windows 7 installation and there it worked normally. I am also busy installing Unity 5.6.3f1 along with Java8 and Android SDK in a Windows VMware install so I can compile my code there. Though not what I want, if it works, I'm already more than happy...
     
  5. Reizla

    Reizla

    Joined:
    Nov 5, 2013
    Posts:
    136
    Java9 JDK working like a charm and environment variables set and working (checked with "javac" in command line terminal).

    On my previous message, I've made sure that my Windows (VM and pure install) settings and Android SDK settings match that of the one I use under Ubuntu. Oddly enough, I still get that error when compiling under Ubuntu, but it's working perfectly in the VM and pure Windows install.

    Looks like I have a lot to work around to get my code to compile under Ubuntu, but for now at least I can get it done in the VM. Will take a peek later on at the problem. For now it's time to get started on coding the thing I wanted to make ;-)
     
    wenderRondonia likes this.
  6. Deleted User

    Deleted User

    Guest

    Did you find any solution for your sdk problem?
    I am also having a similar problem.
    Code (csharp):
    1. Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.  See the Console for details.

    I have the latest version of sdk installed.
     
  7. Reizla

    Reizla

    Joined:
    Nov 5, 2013
    Posts:
    136
    Looks like I've found the problem (finally). This is an old thing that also happened to an older Android SDK repository for Windows 2 years ago. Somehow the ./Tools directory for Android is missing some REAL important stuff and you need to download the correct version of the directory.
    Info here: https://stackoverflow.com/questions/42538433/not-finding-android-sdk-unity

    After this Unity gives me a new error:
    This clearly is because I'm using Java 9 JDK instead of the Java 7 JDK. Since you cannot download the Java7 JDK from Oracle anymore I've been Googling my *ss off and finally found a site where I can download it (though in .RPM format): https://mirror.its.sfu.ca/mirror/CentOS-Third-Party/NSG/common/x86_64/ On this site you can download every flavour of Java 7 and Java8 JDK available.
    I'm working with Ubuntu and cannot use the .RPM file and need to convert it to .DEB. There's a nice guide on that one here: https://www.howtogeek.com/howto/ubuntu/install-an-rpm-package-on-ubuntu-linux/

    At this moment I'm typing this without checking the latest part, but I need to because in a few minutes my DSL will be down for repairs. I will get back (and edit this post) with results after the DSL is up again.

    [EDIT]
    DSL still up and I fixed the problem!

    The Java7 JDK I posted was a VM version which doesn't work with Unity. Instead I used the latest Java8 JDP I already had downloaded in the past and pointed to that one (still have the Java9 JDK installed for my browser and other stuff). With Java8 JDK and the Android SDK repository fix I posted before I can compile for Android under Linux (now remove Unity from the Windows VM install).
     
    Last edited: Oct 31, 2017