Search Unity

Android putting my Unity Game icons in a white circle. But not all of them.

Discussion in 'Android' started by mdentonetc, Oct 24, 2017.

  1. mdentonetc

    mdentonetc

    Joined:
    Jul 23, 2012
    Posts:
    13
    I noticed today on my Pixel 2 that Android is now putting some of my game icons in a white circle, making my icons small and hard to read. Reading up it seems that Android now says that we should be specifying a round and non-round icon if we don't want a round, for when it will be supported, which it's unclear when that is. Does Unity have a way to do this? Should I just start making all of my Android icons round from now on?

    Here's a screenshot of some examples. The Simcoach folder are my games. Some are round, some are not. WyldWood is a new game, Harness Hero is months old, but the cutoff could be before it was released.

    https://imgur.com/a/1EIUe

    Note, that while this is supposed to be a consistency thing by Google, there is currently no consistency yet.
     
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    360
    We are working on supporting adaptive icons in Unity editor. For now if you want your icons to look the same as before, in player settings select "Target API Level" lower than 26. If you were using "Automatic" option before, I'd suggest to go with API level 25.
     
    kalamtech likes this.
  3. barryrowe

    barryrowe

    Joined:
    Jun 22, 2017
    Posts:
    1
    Targeting API Level 25 did not work for us, but we did find that using an Icon of an absurd size of 2048x2048 forced the icon to look correct on the pixel XL w/ Android 8.
     
  4. infosekr

    infosekr

    Joined:
    Jul 12, 2013
    Posts:
    31
    Barryrowe, I tried using a 2048x2048 icon but I still see the same problem. Can you give more details on what you changed to get this to work? Inside the generated APK I still see the largest icon is 192x192 in the res/drawable-xxxhdpi-v4/ folder, regardless of source icon size.
     
  5. GlennSnyder

    GlennSnyder

    Joined:
    Jan 24, 2018
    Posts:
    5
    Has this been updated at all?
     
  6. MajidKhosravi

    MajidKhosravi

    Joined:
    Jun 21, 2013
    Posts:
    37
    I second this, any update on Adaptive Icons from Unity yet?

    Thanks.
     
  7. _Paulius

    _Paulius

    Mobile Developer Unity Technologies

    Joined:
    Jul 8, 2014
    Posts:
    172
    Support for adaptive icons is already available in 2018.1 beta, but it will not be backported to previous versions.

    It should be fairly simple to add adaptive icon to older versions manually, though. You just need to create a `Plugins/Android/res` folder in you Unity project and the adaptive icon files there, the simplest way is to create a new Android studio project, set up the correct images there and copy all the "drawable" and "mipmap" folders to your Unity project.

    Then change the name of `mipmap-anydpi-v26` to `drawable-anydpi-v26` and inside it `ic_launcher.xml` to `app_icon.xml'. Alternatively you can stick with `mipmap` and add a custom manifest with "
    android:icon="@Mipmap/ic_launcher" but then you'll also need to provide legacy single layer icons as well.

    After these steps adaptive icons should be properly loaded on devices that support it, but older Android versions would still show the `legacy` png icons.
     
    Last edited: Feb 7, 2018
    JuliusM likes this.
  8. MajidKhosravi

    MajidKhosravi

    Joined:
    Jun 21, 2013
    Posts:
    37
    That worked, thanks so much,

    Here is my file structure in case anyone else has the same problem:

    Android/Plugins/res/drawable/ic_background.png ( 1536 x 1536 pixels )
    Android/Plugins/res/drawable/ic_foreground.png ( 1024 x 1024 pixels )
    Android/Plugins/res/drawable-anydpi-v26/app_icon.xml ( Contents below )

    <?xml version="1.0" encoding="utf-8"?>
    <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_background"/>
    <foreground android:drawable="@drawable/ic_foreground"/>
    </adaptive-icon>

    And that's it!
     
  9. apaix

    apaix

    Joined:
    Aug 10, 2017
    Posts:
    21

    When I do this on 8.1, my icon crashes the Pixel Launcher. Has anyone else experienced this?
     
  10. apaix

    apaix

    Joined:
    Aug 10, 2017
    Posts:
    21
    I think it was related to creating the icons in raw Photoshop. I created them as image assets in Android Studio, then ported them over as detailed and it worked!!

    Thanks!
     
  11. unity_0bQAQmhY4fPJGQ

    unity_0bQAQmhY4fPJGQ

    Joined:
    Dec 17, 2017
    Posts:
    1
    Hey I was trying to do the workaround and it did not worked.
    my paths were:
    Assets\Plugins\Android\res\drawable with the files: ic_background,ic_foreground
    and
    Assets\Plugins\Android\res\drawable-anydpi-v26 with the file: app_icon

    inside the app_icon

    <?xml version="1.0" encoding="utf-8"?>
    <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_background"/>
    <foreground android:drawable="@drawable/ic_foreground"/>
    </adaptive-icon>

    when I remove the icon from the player settings, I get the default Unity icon
    when I leave it there, the new icons that I imported from android studio are not showen.

    please help
     
  12. Suduckgames

    Suduckgames

    Joined:
    Nov 28, 2016
    Posts:
    143
    There is no need to specify it in the manifest? app_icon.xml will be overrided or merged?

    as https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive stated. Both layers must be sized at 108 x 108 dp in case this help someone