简体   繁体   English

Flutter 不更新启动器图标

[英]Flutter doesn't update launcher icon

I created a new icon for my app and I used flutter launcher icons for generate the launcher icon.我为我的应用程序创建了一个新图标,并使用颤振启动器图标来生成启动器图标。 In the midmap folders there is the ic_launcher.png and if I open it is my new launcher icon.在中图文件夹中有 ic_launcher.png 如果我打开它是我的新启动器图标。 But if I install the app via android studio on my phone it shows the old icon.但是,如果我通过手机上的 android studio 安装该应用程序,它会显示旧图标。

It happened to me even when I created the first icon.即使我创建了第一个图标,它也发生在我身上。 It went all well but the app had the default flutter icon.一切顺利,但该应用程序具有默认的颤振图标。 It started to show the new one when I changed the app name but now I cannot change it again.当我更改应用程序名称时,它开始显示新的,但现在我无法再次更改它。

I already tried with the flutter-launcher-icons widget, to use flutter clean, ecc... but it doesn't change.我已经尝试过使用 flutter-launcher-icons 小部件来使用flutter clean、ecc ...但它没有改变。 Why there is this problem?为什么会出现这个问题? And where the app takes the old logo information?该应用程序在哪里获取旧徽标信息?


UPDATE更新

I discovered a workaround for this problem.我发现了解决此问题的方法。 If I delete all generated files (even the ones that looks right) and then I regenerate them when I install the app on the phone the icon looks right.如果我删除所有生成的文件(即使是看起来正确的文件),然后在手机上安装应用程序时重新生成它们,图标看起来也正确。

There will be 5 different mipmap files within android/app/src/res/main folder.在 android/app/src/res/main 文件夹中将有 5 个不同的 mipmap 文件。 Each mipmap consists icon launcher of different dimensions and pixels.每个 mipmap 包含不同尺寸和像素的图标启动器。 Make sure you have replaced all 5 icon launchers with your generated Icon Launcher.确保您已将所有 5 个图标启动器替换为您生成的图标启动器。

You can Generate Icon Launcher from here .您可以从此处生成图标启动器。

I've had a similar problem, where the app icon would always be the androids default one.我遇到了类似的问题,应用程序图标始终是 androids 的默认图标。 The way I fixed this, was by looking at the following Github thread: https://github.com/flutter/flutter/issues/59305我解决这个问题的方法是查看以下Github 线程: https ://github.com/flutter/flutter/issues/59305

I noticed, that there was an error in my AndroidManifest.xml, where the android:icon="@mipmap/launcher_icon" was not inside the application-tag.我注意到,我的 AndroidManifest.xml 中有一个错误,其中 android:icon="@mipmap/launcher_icon" 不在应用程序标签内。 After placing the ">" after android:icon="@mipmap/launcher_icon", it worked for me.将“>”放在 android:icon="@mipmap/launcher_icon" 之后,它对我有用。

How it looked:它看起来如何:

Not working不工作

How it should look:它应该看起来如何:

Working在职的

I hope this helped我希望这有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM