自适应图标显示默认图标而不是应用程序图标

时间:2018-06-25 18:10:00

标签: android phonegap-build phonegap

我正在使用PhoneGap Build并尝试使自适应图标正常工作。我以前在以下配置中使用了旧版图标:

<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" />

但是它们看起来非常丑陋。因此,我使用Android Studio(图像资产)创建了新的自适应图标,并将其导入到项目的config.xml中(我不使用Android Studio进行构建或编码)。我将此添加到了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" />

当我安装该应用程序时,仅显示默认的PhoneGap图标。

我在做什么错?我确保所有路径都是正确的,并且也没有构建错误。我什至尝试切换图标,并从GitHub应用程序中使用了ic_launcher_background.xmlic_launcher_foreground.xml,它们也无法正常工作,所以我的猜测是问题不在于图标,而在于将它们注入AndroidManifest的代码。 xml

可能值得注意的是,在构建过程中出现此错误:

This app does not have launcher icons defined

我不知道为什么。

0 个答案:

没有答案
相关问题