[英]Ionic app icon doesn't change
I'm building an android app with Visual Studio 15 Community, Ionic and Apache Cordova and I would like to update the icon of my ionic app. 我正在使用Visual Studio 15社区,Ionic和Apache Cordova构建一个android应用程序,我想更新我的ionic应用程序的图标。 I'm emulating the app with Genymotion but I get the same result using the build-in android emulator from VS15. 我正在用Genymotion模拟该应用程序,但是使用VS15中的内置android模拟器可以获得相同的结果。
Additionally, I used a blank ionic project. 另外,我使用了一个空白的离子项目。
I added the source of my icon in the config file (please note that I added the density myself, it has not been generated) 我在配置文件中添加了图标的来源(请注意,我自己添加了密度,尚未生成)
<icon src="resources/android/icon/icon.png" density="xxxhdpi" />
Created the app logo based on this blueprint: http://ionicframework.com/docs/cli/icon-splashscreen.html 根据以下蓝图创建了应用徽标: http : //ionicframework.com/docs/cli/icon-splashscreen.html
Placed the .png file in the specific folder 将.png文件放在特定的文件夹中
$ ionic resources --icon
because I think that as soon as I build the app (pressing the play button in VS15) it does all the work for me 实际上,我并没有尝试使用$ ionic resources --icon
来执行命令来更新我的资源,因为我认为,一旦我构建了应用程序(按VS15中的播放按钮),它就会为我完成所有工作 Maybe I'm getting something wrong here because usually this isn't a big deal. 也许我在这里出错了,因为通常这没什么大不了的。 I really appreciate all your answers, thank you for taking the time to deal with this! 我非常感谢您的所有回答,感谢您抽出宝贵的时间处理此问题!
As of the latest updates. 截至最新更新。 if the splash and the icon did not update. 如果启动画面和图标未更新。 that is because the latest version of ionic creates 2 md5 files of the icon and the splash. 那是因为最新版本的ionic会创建2个md5文件的图标和启动画面。 which i guess is locking the updates. 我猜这是锁定更新。
just delete these 2 files: “ icon.png.md5
” and “ splash.png.md5
”. 只需删除以下两个文件:“ icon.png.md5
”和“ splash.png.md5
”。
then run the following command : ionic cordova resources
然后运行以下命令: ionic cordova resources
then splash and the icon should be updated. 然后启动,图标应更新。 might be helpful to someone out there cheers!! 可能对有人加油有帮助!
Density is set to "xxxhdpi" density. 密度设置为“ xxxhdpi”密度。 Maybe you need to add another screen options? 也许您需要添加其他屏幕选项? Try to refresh project, too. 也尝试刷新项目。
As mentioned earlier by a user whos post has been deleted (why?), all I had to do was to 就像之前提到的某个用户的帖子已被删除(为什么?)一样,我要做的就是
$ ionic resources
输入命令$ ionic resources
A quick note: I didn't know that I had to install the tools (Android SDK, Apache Cordova etc.) because I thought that Visual Studio downloads them due to the first build so why installing it locally. 快速说明:我不知道我必须安装这些工具(Android SDK,Apache Cordova等),因为我认为Visual Studio是由于首次构建而下载了它们,因此为什么要在本地安装它。 You must install them locally, it will not work without the tools installed on your machine. 您必须在本地安装它们,如果没有在计算机上安装工具,它将无法正常工作。
Hope I could help 希望我能帮上忙
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.