Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Java 9 (JDK 9) support by Unity Android

Discussion in 'Android' started by Yury-Habets, Oct 9, 2017.

  1. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    983
    Announcement:

    If you are using JDK 9 or JDK10 and trying to build for Android in Unity - you're most likely to have your build failed, with message like "Unable to list target platforms" - "Error:Invalid command android".

    We are working together with Google on fixing this issue - it requires fixes on Unity side, but also Android SDK tools need to be updated to be compatible with latest Java.

    In the meanwhile, we recommend using Java 8 (JDK 8) 64-bit.

    We apologize for the inconvenience caused!
    Your Unity Mobile team

    EDIT: looks like if you have different JDKs installed, despite selecting JDK8 in the Unity Editor preferences, Android SDK continues to use later JDKs. The only known solution at the moment is to UNINSTALL JDK9 and JDK10, and have only JDK8 (64-bit) installed.

    UPDATE: in Unity 2018.3, we are shipping OpenJDK together with Unity. By default, it will be used by the build pipeline, which means - no external JDK installations are needed, no version hassle etc.
     
    Last edited: Oct 2, 2018
  2. pesahov

    pesahov

    Joined:
    May 24, 2017
    Posts:
    12
    On the scratch system macos high sierra 10.13 I've installed JDK 9 on by homebrew and Unity 2017.2.0f2 didn't work with it.

    After it downloaded JDK 8 from Oracle site and changed path in Unity settings but the issue didn't solve.
    After adding export JAVA_HOME=`/usr/libexec/java_home -v 1.8` to ~/.bash_profile it didn't work too.

    Only full removing JDK 9 by command brew cask uninstall jdk - solved the issue
     
    surajsirohi1008 likes this.
  3. peteyhayman

    peteyhayman

    Joined:
    Mar 5, 2017
    Posts:
    18
    yarr weird it worked after uninstalling Java 9

    running unity 2017.2.0f3 windows 10
     
  4. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    983
    @peteyhayman I assume you forgot to update Unity preferences and it's still using the older JDK. You can make sure by checking the Editor log. Unfortunately it's expected to have issues now.
     
  5. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    381
    Im finding that I can build with JDK8 but I cant sign my app. The passes are correct as shown in the console but I get:-
    Code (CSharp):
    1.  
    2. CommandInvokationFailure: Failed to sign APK package.
    3. D:\Android\android-sdk\build-tools\25.0.2\apksigner.bat sign --ks "E:/Shared Documents/Work/Android-KeyStore.keystore" --ks-pass pass:"keyStorePass" --ks-key-alias "appAlias" --key-pass pass:"appPass" "E:\Shared Documents\Work\MyProject\Temp/StagingArea/Package.apk"
    4.  
    5. stderr[
    6. java.lang.UnsupportedClassVersionError: com/android/apksigner/ApkSignerTool : Unsupported major.minor version 52.0
    7.     at java.lang.ClassLoader.defineClass1(Native Method)
    8.     at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    9.     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    10.     at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    11.     at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    12.     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    13.     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    14.     at java.security.AccessController.doPrivileged(Native Method)
    15.     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    16.     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    17.     at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
    18.     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    19.     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    20.     at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
    21. Exception in thread "main"
    22. ]
    23.  
    I have tried everything I can find, Reinstalling Android Studio, updating the JAVA_HOME environment variable, Deleting build-tools\25.0.2 (to force it to us 23.0.2), copying java.exe from System32 to SystemWOW64, (and other suggestions here ) But nothing works. Any ideas?

    EDIT This was in 2017.1f1 by the way- I can even build an unsigned version in 2017.1.2 (see following post)
     
    Last edited: Oct 18, 2017
  6. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    381
    Also I just tried 2017.1.2p1 and that wont even build an unsigned version. I get:

    Code (CSharp):
    1. CommandInvokationFailure: Failed to re-package resources.
    2. D:\Android\android-sdk\build-tools\25.0.2\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "D:/Android/android-sdk\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.example.androidnative:com.example.an_googleplay:com.stansassets.androidnative:com.stansassets.mnp:com.google.android.gms.appinvite:com.google.android.gms.base:com.google.android.gms:com.google.android.gms.gcm:com.google.android.gms.iid:com.google.android.gms.plus:com.google.android.gms.tasks:android.support.v4 -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\androidnative\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\an_googleplay\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\AN_Res\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\mobile-native-popups\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\play-services-appinvite\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\play-services-base\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\play-services-basement\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\play-services-gcm\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\play-services-iid\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\play-services-plus\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\play-services-tasks\res" -S "E:\Shared Documents\Work\HURRARICE2017-u2017-1-2-Android\Temp\StagingArea\android-libraries\support-v4-24.1.1\res"
    3.  
    4. stderr[
    5. AndroidManifest.xml:28: error: Error: String types not allowed (at 'configChanges' with value 'mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density').
    6.  
    7. AndroidManifest.xml:35: error: Error: String types not allowed (at 'configChanges' with value 'mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density').
    8.  
    9. ]
    I think thats the relevant part anyways- the log is epic, but after that it goes on about trying overlay files, finding them and processing them, but I dont see any errors there...tho like I say its the biggest log I have ever seen!
     
  7. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    396
    In AndroidManifest.xml find nodes with attributes `configChanges` (probably lines 28 and 35). Then try to narrow down (one by one), which item is not parsed as valid enum-value and thus treated as string: `mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density`
     
  8. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    381
    Thanks for your reply...Trouble is, I dont actually have an AndroidManifest.xml file with that list of flags in it... I think something maybe generating it on the fly... (I'm using UltimateMobile which merges manifests for you, but none have a string like that in)
    And also I am building with the same JDK and Android SDK in both cases above, so why is it only Unity 2017.1.2p1 that is giving me that error? Is it Unity 2017.1.2p1 that is generating that code with a flag that only exists in JDK9 or some newer buildtools (than 25.0.2) or something?
     
    Last edited: Oct 18, 2017
  9. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    381
    Well made a slight step forwards. I discovered that updating android studio made it store its updated sdk files in E:\Users\thisUser\AppData\Local\Android\sdk rather than its previous location. In there I see a buildTools folder with all the new ones. So I updated the Unity preferences location to that.

    BUT it still doesn't work... Now I get:
    Code (CSharp):
    1. E:\Shared Documents\Work\PathToProject\Temp\StagingArea\AndroidManifest-main.xml:8:16-49 Error:
    2.     Attribute application@icon value=(@drawable/app_icon) from AndroidManifest-main.xml:8:16-49
    3.     is also present at AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher).
    4.     Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest-main.xml:8:3-48:17 to override.
    5.  
    But again I dont have any manifests that have an icon value defined as "@drawable/ic_launcher"

    Ive now tried everything on this thread too, to no avail:
    https://issuetracker.unity3d.com/is...ng-the-merging-manifest-files?page=2#comments
     
  10. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    396
    Manifests can be hidden inside `.aar`s of used plugins (try extracting `.aar` as zip-file).
     
  11. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    381
    Ok using E:\Users\thisUser\AppData\Local\Android\sdk rather than its previous location I cant build an unsigned version in Unity 2017.1.0.f1 either now...

    So MONEY MONEY MONEY

    what will it take to get some one to sort this building bullshit out for me. I need iOS too which is also not working- but was with the same project a couple of days ago (and for months before)
     
  12. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    381
    Ok found the culprit UltimateMobile Android Native an_googleplay.aar
    and androidnative.aar

    What can I do about that though?
     
    Last edited: Oct 19, 2017
  13. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    288
    We are aware of this issue and it will be fixed. For now make sure you have android API 24 or newer installed and selected as a target sdk (if not using auto option). The problem is that aapt tool does not allow density value for the configChanges until API level 24. https://issuetracker.google.com/issues/67580651
     
  14. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    381
    thanks @JuliusM I finally got this working- I'm just gonna post what worked for me in case it helps anyone else- I'm not sure exactly which of these steps are 100% necessary but this is what worked for me on Windows 7...
    1) Make sure you are using Unity 2017.1.2p1 (maybe greater, but I didn't try because I know Unity 2017.2 re-introduces a bug in meshCombiner that stops UMA from working)
    2) Update your AndroidStudio/SDK via the download link in the Edit -> Preferences -> ExternalTools/ Android/ SDK Download button.
    2a) I found after updating Android Studio all the sdk stuff had moved from my previous location, and it was now in C:/Users/YourUserName/AppData/Local/Android/sdk (My 'Users' folder is actually on my 'E:' drive but you get the idea) So make sure your Edit -> Preferences -> ExternalTools/ Android/ SDK is actually pointing to where your new SDK stuff _actually is_
    3) Navigate to the above location and check in the 'build-tools' folder to make sure you have 26.0.2 in there
    3a) If you dont have that, open Android Studio and go to File -> Settings, then in that window in the side pane twirl open 'Appearance & Behaviour / System Settings / Android SDK'
    3b) Select the SDKTools tab in the window pane, ensure 'Show Package Details' is checked towards the bottom, and check 26.0.2 and hit 'Apply'. This should make that download and install. after that it should be in 'C:/Users/YourUserName/AppData/Local/Android/sdk/build-tools' If its not, your SDK locations is probably not right, because it will have downloaded it to an 'Android/sdk/build-tools' folder somewhere, so you are going to have to figure out where that is...
    4) Update your JDK (Java Development Kit) *Dont* use the latest version (if you are on this thread I guess you already know jdk 9 is not working lol) instead go here (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) and choose the 'Java SE Development Kit 8u152' version.
    4a) after you have installed that, right click on 'My Computer' or whatever its called now, goto 'Properties > Advanced System Settings' and click on the 'Environment Variables' button. In there look for the 'System Variables' section and find the variable 'JAVA_HOME' edit the value of that so it points to where you just installed Java 8 in the step above (in my case it was c:\Program Files\Java\jdk.1..0_152
    4b) make sure that in Unity Edit -> Preferences -> ExternalTools / Android / JDK your path is set to the new JDK 8 you just installed.
    5) Fix your AndroidManifest files. This will vary an awful lot depending on your project, but I was using UltimateMobile/AndroidNative and that was causing 'merge manifests' to fail during builds.
    This is what they told me to do (and it worked):-
    Code (CSharp):
    1.  
    2. 1) Open main AndroidManifest.xml by path: Plugins -> Android:
    3. 2) Add this field xmlns:tools="http://schemas.android.com/tools" to tag <Manifest
    4. 3) Then add this param tools:replace="android:icon, android:label, android:theme, android:debuggable" to tag <Application
    5.  
    6. ensuring that the <application tag actually has all those things eg android:icon="@drawable/app_icon" etc
    7. 4) Finally open all other AndroidManifest.xml by path (for example): Plugins -> Android -> AN_Res and remove android:icon="@drawable/app_icon" android:label="@string/app_name" from tag <application
    After all that I could finally build and sign my Android apps :)

    Really hope that helps anyone considering throwing themselves off a tall building like I was!!

    (now on to iOS lol...)
     
    Last edited: Oct 20, 2017
  15. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    When can we expect the official fix?
     
  16. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    983
    @MrEsquire this depends on Google. We've reported bugs, they are being addressed.
     
  17. Trys10Studios

    Trys10Studios

    Joined:
    Jun 24, 2013
    Posts:
    44
    This worked for me, I had the JDK 9.0 installed, I now have both the JDK 8.0 and 9.0 installed, added another path to include JDK 8.0 in the environment variables (Windows 10), and redirected that path in the Preferences window in Unity 5. It now works perfectly, thank you!
     
  18. Lloyd_RedironLabs

    Lloyd_RedironLabs

    Joined:
    May 17, 2013
    Posts:
    318
    Ah, so that is why it wasn't building...
     
  19. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    983
    Looks like if you have Java9 installed, it's added to PATH and Android SDK tools are using it despite Unity Editor preferences set to, for example, Java8.
     
  20. Foysal-Ahmed-Emon

    Foysal-Ahmed-Emon

    Joined:
    Mar 13, 2016
    Posts:
    8
    Changing JDK from 9 to 8 works for me.


    Failed to compile resources with the following parameters:
    -bootclasspath

    Thank you Yury-Habets.
     
  21. noah12345678

    noah12345678

    Joined:
    Dec 31, 2017
    Posts:
    1
    java 9 does not work yet any way to fix and i can not get java 8
     
  22. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,380
  23. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,034
    Unity Guys, the tutorial on setting up android for unity is broken and no longer works. This is the tutorial I'm referring to: https://unity3d.com/learn/tutorials...ilding-your-unity-game-android-device-testing

    The set up of the android SDK says to run the SDK manager but if you do it fails and says its obsolete. Anyone have a decent working set of instructions on how to instal the Android SDK that doesn't involve AndroidStudio please.

    Particularly this step fails:

    • Double click the file called android to run it.
     
  24. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    288
    With the android sdk tools version 26 or later the only way to get the graphical user interface for the sdk manager is to use Android Studio. If you really don't want to use Android Studio, the only other way to install sdk components is to use the command line tool which is <android sdk path>/tools/bin/sdkmanager. run sdkmanager with --help to see available options. You will probably want to use --list option to see installed and available packages, then run sdkmanager with
    options to install required tools (specifying build-tools <version> which you want from the available packages, something like 26.0.0) and then run sdkmanager with
    to install android sdk platform versions which you need. If this is not clear, try reading sdkmanager --help output, maybe it will become clearer. As I've said before, the recommended way of installing android sdk and all of it's components is to use sdkmanager UI which is available with AndroidStudio.
     
  25. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,034
    I would prefer to use AndroidStudio but there are no instructions on how to integrate it into the Unity build process
     
  26. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    288
    Just to make it clear: Unity does not need Android Studio to build android applications, it only needs android sdk. However with the latest android sdk versions, the only way to get UI when installing sdk components is to use Android Studio. Once you install / update android sdk, you only have to specify its location inside of Unity editor. Apart from that you don't need Android Studio to build android applications with Unity.
     
  27. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,034
    I must be really thick. I'm trying to tell you the instructions for building Android in Unity don't work. They must be out of date. I installed AndroidStudio but where did it put the Android SDK? I can't find it anywhere. Does anyone have an up to date step by step instructions for how to install the Android SDK that Unity needs to build to Android.

    Bear in mind if I knew how to do these things I wouldn't be needing Unity to do it for me.
     
  28. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    288
    See this post https://forum.unity.com/threads/can-no-longer-get-unity-to-build-for-android.510609/#post-3337962 it shows how to open the sdk manager from the Android Studio and the path where Android sdk is installed. You have to provide that path to Unity editor.
    Note that in the sdk manager there are "SDK Platforms" and "SDK Tools" where you can select which sdk components you want to install.
     
  29. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    983
    @arkon sorry that the tutorial didn't work for you. It says "Checked with 5.3" and it definitely needs an update. I added a task for our team to do so.
     
  30. DaveHoskins

    DaveHoskins

    Joined:
    Sep 9, 2013
    Posts:
    190
    I've got this now. I have Unity 2017.3.1f1
    I have just install JFK 1.8u152 as instructed. I have SDK API levels 15,21,22,25,26,27 intalled on my E drive using Android Studio.
    I set the toolset to, well, I've tried everything.
    I have everything pointed to the various locations under preferences->external tools.
    I have set the enviromnent variable 'JAVE_HOME' which didn't even exist before.
    I still get the 'Unable to get target list...' error, and I'm about to throw the fecking monitor out the bloody window with a large deep roar!!!! - He says calmly and collectedly. - Someone please fix Android builds, otherwise what is the point of using this thing called 'Unity?'
    Thanks,
    Dave.
    edit: Finally! Using this 'tools' set makes the error go away:- https://fossies.org/windows/misc/android-tools_r25.2.3-windows.zip/ but I had to delete the previous 'tools' folder in the sdk, I don't know why.
    *note I have JDK 1.8 and 1.9 installed as I need 9 for something completely unrelated to Unity.

    This is not a fix, it's a bodge with a bit of sticky tape and a couple of staples. Needs some proper work by Unity.
    Also, please test Unity releases on a blank Windows install first, that way any legacy bodge work won't pass under the radar.
     
    Last edited: Feb 26, 2018
    Qbit86 likes this.
  31. ZzappSizzler

    ZzappSizzler

    Joined:
    Jan 15, 2017
    Posts:
    33
    I've been 5 hours on this. Implemented each of the suggestions above. Still not working. Unity, we know it's other people's tools that are the problem, but it sure makes you look bad. You have made an incredible development tool but if people have to go through this just to build on Android, then I want to know, what else can I use?
     
  32. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    983
    Sorry to hear you frustrated.
    Unfortunately you didn't share the editor log with the full info on the problem.
    I suspect that despite setting JAVA_HOME and the locations in Unity preferences, Android tools are still trying to use Java9. The easiest solution to me was to uninstall JDK9.

    I'll pass your offer on testing on a clean PC to our QA team. Thanks for the feedback!
     
  33. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    983
    @ZzappSizzler the only currently known issue with Unity for Android is the Java9 issue in this thread. If you are experiencing anything else - feel free to submit a bug report.
     
    TheKingOfTheRoad likes this.
  34. Trys10Studios

    Trys10Studios

    Joined:
    Jun 24, 2013
    Posts:
    44
    I'm currently reinstalling Unity, Android Studio, and Java SDK. The bundle is not available any longer from Android, you have to install studio, open up the app, and then let it download the tools (it's not explicitly in the install wizard). I tried downloading the tools separately to no avail, going this route actually downloaded (like it used to) all the tools necessary. I guess they really want people using Android Studio :-/

    BTW I am still using Java 8.0 as it works for me, didn't want to try 9.0.
     
  35. Trys10Studios

    Trys10Studios

    Joined:
    Jun 24, 2013
    Posts:
    44
    This is what happened to me as well. I had to open Android Studio, and from there it prompted me to download the SDK.
     
  36. ZoidbergForPresident

    ZoidbergForPresident

    Joined:
    Dec 15, 2015
    Posts:
    50
    Last edited: Mar 30, 2018
    Qbit86 likes this.
  37. GermanViscuso

    GermanViscuso

    Joined:
    Oct 8, 2013
    Posts:
    4
  38. ZoidbergForPresident

    ZoidbergForPresident

    Joined:
    Dec 15, 2015
    Posts:
    50
  39. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    983
    @ZoidbergForPresident correct. The easiest solution is to uninstall JDK9/JDK10 completely.

    Alternatively, you could mess with the Java settings so that Android SDK tools don't use anything other than JDK8... But in this case you're on your own.
     
  40. ZoidbergForPresident

    ZoidbergForPresident

    Joined:
    Dec 15, 2015
    Posts:
    50
    OK, I'm uninstalling everything java related from my Windows 10.

    What do I do to compile an android build of my unity project now?
     
  41. BrunoPuccio

    BrunoPuccio

    Joined:
    Dec 13, 2017
    Posts:
    22
    it would be nice to have an updated list on what you actually need to build for android
     
    CGstunts likes this.
  42. ZoidbergForPresident

    ZoidbergForPresident

    Joined:
    Dec 15, 2015
    Posts:
    50
    Yury-Habets and BrunoPuccio like this.
  43. system-idle

    system-idle

    Joined:
    Dec 13, 2013
    Posts:
    7
  44. gv

    gv

    Joined:
    Feb 22, 2013
    Posts:
    89
    Oh FFS.... It's May 2018.... Why on earth is Android still not working with a fresh download of Unity??

    This is beyond a joke... And no I don't want to download specific versions, delete existing setups, rename folders... I use the Android SDK for other frameworks too... I'm not going to fudge it all up because Unity cannot get their act together....

    Android Studio just works.. Xamarin just works... Flutter just works.... Why on earth months and months after being discovered that Unity DOESN'T just work ???
     
    ChessMax likes this.
  45. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    983
    I couldn't get from your wonderful post what is not working. If you share the details then after years and months your issue may be finally fixed.
     
    tonycoculuzzi likes this.
  46. Gen_Scorpius

    Gen_Scorpius

    Joined:
    Nov 2, 2016
    Posts:
    38
    It's probably very helpful to explicitly note in the Android development documentation that currently only Java 8 is working and in case of problems to remove any existing jdk 9 or 10 installation (or at least try to change the jave home path).

    It took me yesterday a few hours to identify that side-by-side isn't working, regardless of your jdk setting in Unity. This is especially frustrating if you're new to Android development.
     
  47. FoxyShadow

    FoxyShadow

    Joined:
    Aug 14, 2016
    Posts:
    41
    So Unity 2018.1.0f2 still doesn't work with Java 9, 10?
     
  48. gv

    gv

    Joined:
    Feb 22, 2013
    Posts:
    89
    Ahhhhh.. solved.. JAVA_HOME not set.. Really wish the error 'build failure unable to list target platforms' would have told me this.. ah well..
     
  49. lukeid123

    lukeid123

    Joined:
    May 9, 2018
    Posts:
    1
    After being fustrated by this for the past couple of hours, what worked for me was to add the JAVA_HOME variable in Windows and MOVE the Android SDK from AppData and dump it into Program Files in a new folder in Windows. Build and Run, Unity asks to point to the SDK and point to the new location.
     
  50. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    983
    Unfortunately not. Parts of Android SDK are not compatible with Java9, so we have an external dependency here. A radical solution is coming.