Adaptive Icons showing default icons instead of app icons

686 views Asked by At

I am using PhoneGap Build and trying to get Adaptive Icons to work. I previously used legacy icons with the following config:

<icon density="mdpi" src="res/icons/android/mipmap-mdpi/launcher_icon.png" />

<icon density="hdpi" src="res/icons/android/mipmap-hdpi/launcher_icon.png" />

<icon density="xhdpi" src="res/icons/android/mipmap-xhdpi/launcher_icon.png" />

<icon density="xxhdpi" src="res/icons/android/mipmap-xxhdpi/launcher_icon.png" />

<icon density="xxxhdpi" src="res/icons/android/mipmap-xxxhdpi/launcher_icon.png" />

But they look terribly ugly. So I created new adaptive icons with Android Studio (Image Asset) and imported them into my project's config.xml (I don't use Android Studio to build or code). I added this to my config.xml:

        <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">

            <application android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" />

        </edit-config>



        <resource-file src="res/new/drawable/ic_launcher_background.xml" target="res/drawable/ic_launcher_background.xml" />

        <resource-file src="res/new/drawable/ic_launcher_foreground.xml" target="res/drawable/ic_launcher_foreground.xml" />



        <resource-file src="res/new/mipmap-anydpi-v26/ic_launcher.xml" target="res/mipmap-anydpi-v26/ic_launcher.xml" />

        <resource-file src="res/new/mipmap-anydpi-v26/ic_launcher_round.xml" target="res/mipmap-anydpi-v26/ic_launcher_round.xml" />

        <resource-file src="res/new/mipmap-hdpi/ic_launcher.png" target="res/mipmap-hdpi/ic_launcher.png" />

        <resource-file src="res/new/mipmap-hdpi/ic_launcher_round.png" target="res/mipmap-hdpi/ic_launcher_round.png" />

        <resource-file src="res/new/mipmap-mdpi/ic_launcher.png" target="res/mipmap-mdpi/ic_launcher.png" />

        <resource-file src="res/new/mipmap-mdpi/ic_launcher_round.png" target="res/mipmap-mdpi/ic_launcher_round.png" />

        <resource-file src="res/new/mipmap-xhdpi/ic_launcher.png" target="res/mipmap-xhdpi/ic_launcher.png" />

        <resource-file src="res/new/mipmap-xhdpi/ic_launcher_round.png" target="res/mipmap-xhdpi/ic_launcher_round.png" />

        <resource-file src="res/new/mipmap-xxhdpi/ic_launcher.png" target="res/mipmap-xxhdpi/ic_launcher.png" />

        <resource-file src="res/new/mipmap-xxhdpi/ic_launcher_round.png" target="res/mipmap-xxhdpi/ic_launcher_round.png" />

        <resource-file src="res/new/mipmap-xxxhdpi/ic_launcher.png" target="res/mipmap-xxxhdpi/ic_launcher.png" />

        <resource-file src="res/new/mipmap-xxxhdpi/ic_launcher_round.png" target="res/mipmap-xxxhdpi/ic_launcher_round.png" />

When I install the app, only the default PhoneGap icon is displayed.

What am I doing wrong? I made sure all the paths are correct and there is no build error either. I even tried switching icons and used ic_launcher_background.xml and ic_launcher_foreground.xml from a GitHub app and they also didn't work, so my guess is the problem is not with the icons but with the code injecting them into AndroidManifest.xml

It may be worth noting, in the build I get this error:

This app does not have launcher icons defined

And I have no idea why.

0

There are 0 answers