Xcode 10 应用程序图标未显示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50771256/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 10 app icon not showing
提问by Vlad
Recently updated to Xcode 10 beta and my App that previously has correct icon displayed when built and ran from Xcode 9.4 to device now shows the default blank icon when running in Xcode 10.
最近更新到 Xcode 10 beta,我的应用程序以前在构建时显示正确的图标并从 Xcode 9.4 运行到设备,现在在 Xcode 10 中运行时显示默认的空白图标。
When opening AppIcon asset it shows icon correctly in all the placeholders without any warning icons. When tapping on new "Show Slicing" I do not see anything.
打开 AppIcon 资产时,它在所有占位符中正确显示图标,没有任何警告图标。当点击新的“显示切片”时,我什么也没看到。
Anyone any clues how to fix this so app icon shows?
任何人都知道如何解决此问题以便应用程序图标显示?
采纳答案by Peter Wiley
On 6/19/18 Apple released Xcode 10. beta 2. Upgrading solved the problem I was having with icons not appearing. So, a bug in Xcode 10.0 I guess.
2018 年 6 月 19 日,Apple 发布了 Xcode 10. beta 2。升级解决了我遇到的图标未出现的问题。所以,我猜是 Xcode 10.0 中的一个错误。
回答by developius
I've been battling with this all day, it wouldn't show up in the simulator or a real device.
我一整天都在与它作斗争,它不会出现在模拟器或真实设备中。
Eventually I got it to work by making sure the Target Membership for the AppIcon was set to the app name and that the Location was "Relative to Project".
最终,我通过确保 AppIcon 的目标成员资格设置为应用程序名称并且位置是“相对于项目”来使其工作。
回答by edison
Same issue occurs after updated to Xcode 10 beta.
更新到 Xcode 10 beta 后出现同样的问题。
I might fixed it by changing the active developer directory to Xcode 10:
我可能会通过将活动开发人员目录更改为 Xcode 10 来修复它:
sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer
sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer
Or select Xcode 10.0
in Xcode->Preferences->Locations->Command Line Tools
.
或Xcode 10.0
在 中选择Xcode->Preferences->Locations->Command Line Tools
。
Hope this helps.
希望这可以帮助。
回答by MuSoundiX
For me the solution was deleting the AppIcon file in the assets folder and then add it again (which also means re-adding the images). I don't know why, but this fixed it for me.
对我来说,解决方案是删除资产文件夹中的 AppIcon 文件,然后再次添加它(这也意味着重新添加图像)。我不知道为什么,但这对我来说修复了。
回答by James Trickey
I was testing on the iPad, and in my case the problem was that the default AppIcon did not include any iPad slots.
我在 iPad 上进行测试,就我而言,问题是默认的 AppIcon 不包含任何 iPad 插槽。
I don't know if this is something to do with the way my app was initialised (I'm using react native) but I was trouble shooting for ages and didn't even think to check they were there. Silly me...
我不知道这是否与我的应用程序的初始化方式有关(我使用的是本机反应),但我多年来一直在解决问题,甚至没想到检查它们是否存在。傻我...
To fix this i removed the existing icons, clicked the + button and selected ['App Icons & Launch items' -> 'New iOS App Icons'] as shown bellow. Then I just populated as expected.
为了解决这个问题,我删除了现有的图标,单击 + 按钮并选择 ['App Icons & Launch items' -> 'New iOS App Icons'],如下所示。然后我就按预期填充了。
回答by Matheus Gomes
In my case the Xcode was using "Use Asset Catalog" in the App Icons Source. To see that you can go to Project->General->App Icons Source.
在我的例子中,Xcode 在 App Icons Source 中使用了“Use Asset Catalog”。要查看您可以转到 Project->General->App Icons Source。
To fix it I selected "Migrate" and created a new Assets Catalog. When I did that, the oldest assets catalog got a warning in the App Icon. So I uploaded the icons to this oldest catalog again and deleted the provisional catalog.
为了修复它,我选择了“迁移”并创建了一个新的资产目录。当我这样做时,最旧的资产目录在应用程序图标中收到警告。所以我再次将图标上传到这个最旧的目录并删除了临时目录。
The App Icons Source returned to show "AppIcon" and it worked.
App Icons Source 返回显示“AppIcon”并且它起作用了。
回答by yairsz
I got this issue after changing asset catalogs. I believe what fixed it was selecting the AppIcon asset and selecting and deselecting target membership to the main app target. This was on Xcode 10 proper.
更改资产目录后我遇到了这个问题。我相信修复它的是选择 AppIcon 资产并选择和取消选择主应用程序目标的目标成员资格。这是在 Xcode 10 上正确的。
回答by Brendan Ballon
Make sure your "App Icons Source" has your AppIcon selected under "App Icons and Launch Images" Sometimes your AppIcon can be named something like "AppIcon-1" in your Assets.xcassets folder.
确保您的“应用程序图标源”在“应用程序图标和启动图像”下选择了您的 AppIcon 有时您的 AppIcon 可以在 Assets.xcassets 文件夹中命名为“AppIcon-1”。