Search Unity

Anyone know if Unity supports Android 8 / Android O / Api 26 in 5.6.2?

Discussion in 'Android' started by jason_yak, Jun 27, 2017.

  1. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    Hey all,

    Does anyone know if there's any reason to 'not' build against the latest SDK, any known issues? I can't spot any mention of Android 8 being specifically supported in Unity 5.6.2, thanks!
     
  2. AgusB

    AgusB

    Joined:
    Jun 20, 2013
    Posts:
    65
    I haven't built against the latest SDK, but apps built against Nougat SDK work fine in android O, at least in my experience.
     
  3. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    Well I've got the latest API installed, but not sure whether it's being picked up or not. Unity doesn't have it selectable as an option in the minimum api level, but perhaps it's just compiled against by being installed?! Either way it hasn't seemed to cause any issues for devices for me.. but yet to test a device Android 8.
     
  4. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @jason_yak we do testing against latest O versions. There are a few issues, otherwise should work fine.. Please note that O is not released yet, so it's not a final version which could still have issues.

    It probably does not make sense to set minimum API to O. As for the target API:
    - in 2017.1, we introduce a "target API" selector. by default it's set to "maximum installed", or you can select your own level
    - before that version, target api level was decided as the latest installed SDK platform level.

    https://developer.android.com/guide/topics/manifest/uses-sdk-element.html
     
  5. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    Thanks, yea I wasn't going to set as minimum. It was just a cautionary question.. the thing is I'd seen on wiki that Android O was released a couple of weeks back.. but perhaps it was just a beta and I misread. The Android SDK Manager also has it listed which lead me to thinking it was out. Anyway, I was more just putting it out there to see if anyone was like - STAY AWAY from it. I've just had issues before where I've grabbed the latest SDK api and then it's caused issues with my compile process, but I haven't seen any hiccups at all.
     
  6. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Yeah there might be issues with the Unity build when installing preview SDK/tools. Good to know it works!
     
  7. SimonJoslin

    SimonJoslin

    Joined:
    Aug 1, 2013
    Posts:
    3
    Does anyone know which will be the oldest version of Unity that will see support for Android 8? Ie will we see support for it in Unity 5.6, 5.5 or even 5.4?
     
  8. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @SimonJoslin what do you mean by "Android 8 support"? We won't probably add Oreo to the "minimum sdk version" dropdown list, however the urgent fixes for Android 8 are already in 5.6.3p4 and are planned to land in 5.5 as well.
     
  9. TinyTitanAndrew

    TinyTitanAndrew

    Joined:
    Sep 11, 2017
    Posts:
    9
    @Yury-Habets We're building for Android from Unity 2017.1.1f1 and we're still getting the Android O black screen issue, Android SDK is completely up to date and the target API drop-down is set to it's default of maximum installed. Any thoughts on some things we could try?
     
  10. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    guneyozsan and assetstoreoffers like this.
  11. TinyTitanAndrew

    TinyTitanAndrew

    Joined:
    Sep 11, 2017
    Posts:
    9
    Awesome, thanks a lot!
     
  12. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    @Yury-Habets : We installed latest 2017.1.1p2 but, we still didn't see Android Oreo in Target API dropdown list.
    Are we missing anything? We have Latest Android Oreo SDK platform installed.
     
  13. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Just use the "Automatic (highest installed)" option for the target API level (taken that you have Android 8.0 platform installed in your Android SDK). We'll add Oreo to the list but it's more of a cosmetic/UI update.

    I was talking about the fix for the black screen which made it into this version.
     
    guneyozsan likes this.
  14. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Cool! Thanks for confirming :)
     
  15. LeeMan93

    LeeMan93

    Joined:
    Aug 10, 2017
    Posts:
    1
    @Yury-Habets , im using unity5.6.1f1 and built on Android 8 device. And some UI can't display and crash . What can i do? Should i update a latest version of unity or latest sdk build tool ?? Please tell me .
    Regard!
     
  16. daoth90

    daoth90

    Joined:
    Jul 28, 2016
    Posts:
    7
    Up
     
  17. electroid

    electroid

    Joined:
    Mar 9, 2017
    Posts:
    2
    Last edited: Oct 24, 2017
  18. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    electroid likes this.
  19. ev3d

    ev3d

    Joined:
    Apr 19, 2013
    Posts:
    327
    what about api 27?
     
  20. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,269
    It is confusing that Unity lists up to API 25 only in "Target API Level" - but if you have 26 installed, it will use it when you choose "Automatic (highest installed)".
    Why does it not list all of those installed?
     
    Swapan01 likes this.
  21. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @andyz we are adding it to the list. (the list is hardcoded rather than dynamic. To make it dynamic we'd have to invoke an external utility and wait for it to finish).
     
    zakirshikhli, wccrawford and andyz like this.
  22. redmugstudios

    redmugstudios

    Joined:
    Dec 21, 2016
    Posts:
    60
    Hey Yury, how is the status now? I'm using 2017.3.0p1 and API 26 and 27 is still not being displayed.
    Its been 4 months... that's a little long don't you think?
     
    ShoaibUsmani and Deleted User like this.
  23. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    One extra vote for explicit API 26 support.

    We can't use API 27 due to an Android 8.0 crash on Admob (as distributed with Appodeal) here:

    https://stackoverflow.com/questions...ateexception-only-fullscreen-activities-can-r

    It's easy to target API 26 locally just by uninstalling the SDK, but now we have *no way* to target API 26 using Unity Cloud Build.

    And this is why modern "indie" development is a continual disaster of telling four different companies that version X of Y with Z of W is breaking with your use of version P of Q. Seriously, some days I swear I might as well be back in a large company again.
     
    ShoaibUsmani and wenderRondonia like this.
  24. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    I wonder if just hacking PlayerSettings.asset and typing 26 for AndroidTargetSdkVersion works...

    And I wonder what will happen on a UCB machine even if it works on mine. AH well, only one way to find out...
     
    ShoaibUsmani likes this.
  25. redmugstudios

    redmugstudios

    Joined:
    Dec 21, 2016
    Posts:
    60
    Have you tried it? Got any success?
     
    ShoaibUsmani likes this.
  26. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    Yes and yes. Basically, as far as I can see, that Enum is treated as an int internally, and everything works from there, including UCB.

    Which is really intelligent design by the Unity engineers because it means you can pretty much always target any minSDK, it's just that the Editor UI might not be up to date.

    Of course, it would be wonderful if the docs mentioned details like this rather than always seeming like an exercise in writing the minimum-possible-documentation that is guaranteed not to say anything inaccurate, but they're slowly getting better. We finally have official confirmation of the internal behaviour of MeshFilter.mesh (which everyone always knew, it just wasn't really explained in any concrete technical terms), for example.
     
    ShoaibUsmani likes this.
  27. trainee_gurgaon

    trainee_gurgaon

    Joined:
    Jan 29, 2018
    Posts:
    1
    NO, This is not working for me. In PlayerSetting.asset file I've changed AndroidTargetSdkVersion to 26 from 0. And for testing I'm using Pixel2 simulator at API level 26, But is not working. It is showing a black screen while running the game.
     
    ShoaibUsmani likes this.
  28. Leonardo88

    Leonardo88

    Joined:
    Nov 12, 2016
    Posts:
    4
    Hi all, i' ve a problem using network feature on Android > 8.
    The things that is not working is only network feature. My app open a connection trough a php script and makes query to a mysql DB. All the things is working until the Oreo devil version. In this version, every functions works, included the google login plugin (wich uses obviously the network functions) but the app is (apparently) not able anymore to reach the php and the DB because all the output I need is = 0 .

    please I'm going mad whit this, I already tried with Internet access ->Require and .Net 2.0 as compatibility level under player settings wich fixed the send email functions in past, wich were not working under OREO.

    hope someone can help me!!!
     
    ShoaibUsmani likes this.
  29. llluuo_

    llluuo_

    Joined:
    Apr 20, 2017
    Posts:
    6
    this is so annoying. Since I have both Android Studio and Unity in my pc, my Android Studio automatically updated yesterday and the sdk version now is 3.0. Which Unity build doesn't support. And I have to download a sdk 26 again to replace that. Soooo stupid!
     
  30. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Can you please elaborate on what has been updated and does not work with Unity?
     
  31. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    It's coming into 2017.4.2. (earlier versions to follow).
    Apologies for the delay.
     
    guneyozsan and ferretnt like this.
  32. YD_JMysior

    YD_JMysior

    Joined:
    Aug 4, 2016
    Posts:
    60
    Hi, I'm seeing some weird behaviour. Unity on Mac - version 5.6.4p4. Also latest Android SDK.
    In my project A I was able to hack the ProjectSettings.asset (just opened it with a text editor) file like ferretnt suggested. The project built no problem and Google Play console says the target API of the .apk is 26.
    In my project B I'm not able to hack the ProjectSettings file (see screenshot) and even tho target API is set to "Automatic (highest installed)", the built .apk has target API at 22.

    screenshot
     
  33. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Hacking with the assets is not encouraged.

    The versions where the target SDK dropdown is not present are following "automatic (highest installed)" pattern, meaning the target SDK is the latest SDK platform you have installed in your Android SDK.

    If you want it to be 26 - please install SDK Platform 26 in your SDK.
     
  34. YD_JMysior

    YD_JMysior

    Joined:
    Aug 4, 2016
    Posts:
    60
    Hi Yury-Habets,
    the problem is I have the SDK 26 installed - and even tho "Automatic (highest installed)" is selected, the target level ends up to be 22 (according to Google Play Console). Is there some sort of cache I can delete so Unity refreshes the info on the installed SDK?
     
    Matti-Jokipii likes this.
  35. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    835
    Do you have Assets/Plugins/Android/AndroidManifest.xml file in your project? If you do, check what target sdk level is set there. In latest Unity versions we always overwrite the manifest value with the value selected in the editor, but if you use an older version of Unity, this might not happen. So if you have the manifest file, you can set the target level to 26 there.
     
    Yury-Habets likes this.
  36. YD_JMysior

    YD_JMysior

    Joined:
    Aug 4, 2016
    Posts:
    60
    Hi JuliusM. Thanks! That was it! Changing the XML manifest did the trick
     
    Yury-Habets likes this.
  37. realgamingart

    realgamingart

    Joined:
    Apr 10, 2014
    Posts:
    20
    JuliusM Thank you So much Sir . You are Awesome and good !!!
     
  38. BigScary

    BigScary

    Joined:
    Jun 4, 2014
    Posts:
    7
    I'm stumped. I've chosen "use highest installed" in Unity and in Android Studio, I have ONLY 26+ installed because I explicitly uninstalled all the earlier versions via Studio's SDK manager. Still my output APKs from Unity indicate:

    platformBuildVersionCode="25"

    If I don't have 25 installed, how is Unity building against it? How do I troubleshoot this?
     
  39. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    What is the targetSdkVersion then?
     
  40. Tommi-Kiviniemi

    Tommi-Kiviniemi

    Joined:
    Aug 21, 2014
    Posts:
    8
    Hi. The target list is not just cosmetic. We have several build machines with several different versions of SDKs installed for several projects. We need to be able to lock the SDK version on a per-project basis. Also, we frequently install new SDKs and if we just use latest any such update would accidentally be shipped without any QA. I repeat that we can NOT take the risk with just "use latest", and require the ability to lock the version.

    Why are you telling your customers something is cosmetic when it clearly isn't?

    Thanks.
     
  41. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @Tommi-Kiviniemi you may want to consider having a consistent configuration for your build machines, otherwise the produced APK may be just different, not only because of the automatic target SDK version.
     
  42. domdev

    domdev

    Joined:
    Feb 2, 2015
    Posts:
    375
    same here.. how? I'm using unity 5.6 and no option for api 26.. and this coming nov google play wont accept api 25 below..I already install api 26..see in attachment but still showing api lower than that I use this code to check the api version
    static int getSDKInt() {
    using (var version = new AndroidJavaClass("android.os.Build$VERSION")) {
    return version.GetStatic<int>("SDK_INT");
    }
    } Untitled1.png
     
  43. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Your target SDK version is in the manifest of your APK.
     
  44. Bogu-94

    Bogu-94

    Joined:
    Dec 11, 2013
    Posts:
    58
    Currently using 5.5.6 (Can't upgrade it for reasons)
    I have installed API 26 to 28 in the SDK, but there's no option to select that 26. (max is API 23)
    Any help?
     
    abc4769898 likes this.
  45. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Then if you build, the target SDK version should be set to 28 automatically. You can try it out - build and inspect the APK, for example, with "Analyze APK" in Android Studio.
     
  46. uzairamirs

    uzairamirs

    Joined:
    Jan 7, 2015
    Posts:
    8
    I have a confusion. I have API 28 installed and I have selected Automatically installed but when I uploaded the apk to developer console, it gives me the warning again that my apk is not targeting API 26.
    Anyone else has the same issue?
     
  47. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    You may want to try Build => Analyze APK... in Android Studio and check the manifest in your APK.
     
  48. m-y

    m-y

    Joined:
    Sep 22, 2013
    Posts:
    472
    Hello All
    i have same problem
    but i choose Highest installed
    and also
    google play say it is not support api 26 and target api 25
    so what can i do now ! ?
     
  49. BabarDluxSoft

    BabarDluxSoft

    Joined:
    Oct 22, 2018
    Posts:
    1

    Hello m-y did you check your manifest files in project and its targetversionsdk " ? "
     
  50. AnnieN

    AnnieN

    Joined:
    Feb 2, 2018
    Posts:
    5
    Hi,
    If you have "target api 26 not available", try below:
    1/ Install Android Studio
    2/ Open Android Studio, go to SDK Manager and install the SDK platforms with API level of 26 and above
    3/ Copy the link of Android SDK Location (Ex: C:\Users\NoName\AppData\Local\Android\Sdk)
    4/ Open Unity, go to Edit> Reference> External tools and paste the link above to [SDK]
    5/ Close and reopen Unity, choose Target API level with Automatic (highest installed) and build apk
    Hope this help.
     
    enasramadan likes this.