Asset Catalog

RSS for tag

An asset catalog is a type of file used to organize and manage different assets and image resolutions used by your app’s user interface.

Posts under Asset Catalog tag

37 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Reusing string catalog translations in swift packages
Setup I have 2 swift packages and I try to use stirng catalog to manage your localizations I would like to use some specific keys in these packages and some common ones (e.g. "ok_button_tittle") Problem statement I really don't like the idea of creating separate (but the same) translations in these packages I have tried using something like String( localized: "ok_button_title", table: "Localizable", bundle: .main, comment: "Ok button title" ) This does use translations from the main bundle, however this does not automatically create the keys in string catalog Question Is there any possibility to reuse the translations from the main bundle? Maybe there is a hack to make the keys appear automatically in the correct bundle? Or is it a bug?
0
0
92
1w
Assets.xcassets vs. Media.xcassets
In Xcode 16, when I use File > New > Project to create a new iOS app project, Xcode automatically creates an asset catalog file called Assets.xcassets in the project. However, if I later use File > New > File from Template, for example to add an asset catalog to an embedded Swift package within a project, Xcode suggests the default filename Media.xcassets for the file, instead of Assets.xcassets. Why is the default name for this file different in each context? Thank you for explaining this troubling consistency issue which causes me to lie awake at night.
1
0
121
2w
Xcode doc. error: There is no 'asset catalog' in Project Navigator
In several places on https://developer.apple.com/documentation/xcode/configuring-your-app-icon I read: "In the Project navigator, select an asset catalog." But my Project Navigator does NOT contain any "asset catalog". So it's impossible to follow the instructions of the documentation, and thus specify a new app icon (set). I can add that I use Xcode 16.1 on MacOS 15.0.1 Sequoia. I have added a screen shot to document what I am saying. I have also reported this error in https://feedbackassistant.apple.com/feedback/15738182
2
0
232
Nov ’24
Can't compile asset catalog when including iMessage App Icon asset
I'm trying to add an iMessage extension to my app, and upon adding the iMessage App Icon set, I ran into an issue with one specific icon size: 1024x768px, aka 1x 1024x768pt. When I remove this one icon from the icon set, it compiles and runs fine, however I can't push it to the App Store as I get the error: "Asset validation failed. Missing Image Asset. Your app is missing the Large App Icon asset 'AppIcon' in 'Payload/Runner.app/PlugIns/MessagesExtension.appex'." I'm assuming this refers to 1024x768px, as this size placeholder appears upon adding a New Messages Extension Icon to my assets folder, and 1024x1024 is already included and compiles fine with it. However, when I add the 1024x768 icon, and try to run the app, I get the error: "Command CompileAssetCatalog failed with a nonzero exit code" The app icon's filename is correct, it is exactly 1024x768 px, and my contents.json correctly includes : { "filename" : "AppIcon_1024x768.png", "idiom" : "ios-marketing", "platform" : "ios", "scale" : "1x", "size" : "1024x768" } as is the same format for all of my other icons that work. Why am I running into this issue upon inclusion of this one required size? How do I fix it?
1
0
267
Nov ’24
Asset validation failed
I'm trying to build an app using flutter which runs fine on both the Android and iOS side locally, but I cannot submit my app to the store. When I try an 'archive' or a 'validation' I keep getting the error: Invalid large app icon. The large app icon in the asset catalog in “Runner.app” can’t be transparent or contain an alpha channel. For details, visit: https://developer.apple.com/design/human-interface-guidelines/app-icons. (ID: 06a51b84-cfc5-43be-94c3-3ae02e5d1229) I've tried: Making sure my dependencies are up-to-date putting remove_alpha_ios: true in flutter_icons Going icon-by-icon and making sure it does not have an "alpha channel" (opening from Finder and exporting without "Alpha channel" checked) Making sure the icon is not rounded Cleaning my build environment (feels like 100s of times now) JPG icons instead of PNG I don't know what else to do. Nothing is working and I've now wasted multiple days on this problem. I'm new to XCode in general and have never run into something like this before, so if you have any suggestions please treat me like I'm new. I've tried reading the logs that appear when I click "show logs" but there's a lot in there and most of what I have checked into doesn't seem helpful. Is it possible I've missed an Icon somewhere? If so, how can I tell which one it was? IS this even an Icon problem? How do I know? Where do I go from here? Is there more information I can provide that will help? If so, what, and where is it located?
2
1
601
Nov ’24
Heic format image incompatibility issue
I am a developer working on iOS apps. In the demo, I planned to replace the local images with Heic format instead of PNG format, but the actual test results showed abnormalities on this device, while the other test devices displayed normally Heic images are converted by the built-in image conversion function on Mac. I tested multiple Heic images, but none of them were displayed and the image information returned nil,,but PNG images can be displayed normally. device information:
6
0
438
Nov ’24
How do I add alternative app icons for a SwiftUI tvOS app?
I am familiar with providing the main layered app icon for a tvOS project, but I cannot work out how to successfully add support for alternative layered icons in the info.plist and/or asset catalog and/or build settings for a SwiftUI (or Swift) tvOS project. Whenever I check the result of UIApplication.shared.supportsAlternateIcons it returns false I have witnessed other tvOS apps such as Plex successfully switch the app icon, so it must be possible to do. How should the project be configured, what am I missing?
0
0
318
Oct ’24
SVG Assets for regular size class are not being picked up by iPads
I’m encountering an issue with image assets when using SVGs in my app. I need to provide different images for regular and compact width size classes. Here’s what I’m doing: 1. Added SVG image assets for dark and light modes 2. Preserve Vector Data is checked. 3. Appearances is set to `Any, Dark` 4. Set the width class to `Any & Regular` and the height class to `Any` However, when I run the app on iPads, it picks up the images for the compact size class instead of the regular size class ones. Any help or suggestions would be greatly appreciated!
1
0
280
Oct ’24
Native camera and AVCapture image difference
We are trying to build a simple image capture app using AVFoundation and AVCaptureDevice. Custom settings are used for exposure point and bias. But when image is captured using front camera , the image captured from the app and front native camera does not match. The image captured from the app includes more area than the native app. Also there is difference between the tilt angle between two images. So is there any way to capture image exactly same as native camera using AVFoundation and AVCaptureDevice. Native Custom
0
0
343
Sep ’24
App Icon all black on ios17, works on iOS18, building app in Xcode16 beta
In my app I added an AppIcon in the Assets.xcassets folder. I added a any/dark/tinted version of the app icon, in 1024x1024 resolution as a HEIC file, specifying a "single size" iOS option. When I build and run the app in xcode16 beta on iOS18 the icon works as expected, but when I run the same app on iOS17 the icon just shows up as a black rectangle. How do I get the app icon to work correctly on both iOS18 and iOS17?
2
0
649
Aug ’24
Assets are outrageously large in VisionOS builds
I'm developing an app for Apple Vision Pro. The asset directory in my project is small: $ du -sh Assets.xcassets 292K Assets.xcassets However, after build assets in the resulting bundle are 15MB! $ du -sh MyApp.app/Assets.car 15M MyApp.app/Assets.car That's two orders of magnitude! Considering that binaries of the app are a couple of MBs, the app bundle is basically all assets! WTF?! It seems somewhere in build process several very large assets are generated: > assetutil --info Assets.car | grep "SizeOnDisk" | sed 's/^[[:space:]]*"SizeOnDisk" : //' | sed 's/,$//' | sort -rn | head 2860982 2860982 2859215 2749277 2658939 1049666 163374 163374 136454 79949 The top one has this in the output of assetutil: {{ "MipLevel" : 0, "RenditionName" : "avp_app_icon_frame.png", "SHA1Digest" : "1F511AC99BA7EE4B7735FDC84F64BA1CDCB044734ED7D3A4AEC1F07AEA90B969", "SizeOnDisk" : 2860982, "Texture" : { "AssetType" : "Texture Data", "Compression" : "lzfse", "Encoding" : "ARGB", "PixelHeight" : 1024, "PixelWidth" : 1024, "Rowbytes" : 4096, "Texture Pixel Format" : "R32 Float" } } Full 32bpp basically w/ lz compression?! Why? What's going on? How do I turn this off?
1
0
318
Aug ’24
Setting a custom icon for documents
I'm trying to set custom Icons for my documents created in a Mac Catalyst app. The icon I defined appears on iOS apps fine. But on my mac they all have a generic icon. I have added the CFBundleTypeIcons key to my info.plist and added an .icns file to my app but it changes nothing. What am I not doing here that I should be?
2
0
592
Aug ’24
Launch screen is black when using UIImageView in storyboard
I'm trying to add an SVG image to my launch screen. The SVG image is working fine in the main storyboard also used in a UIImageView, but the launch screen remains completely black; the launch screen is set with white background, so it seems to be completely ignored. When I remove the image from the UIImageView the launch screen is shown with correct background color but of course without the whished image. I can also correctly implement text in the launch screen, the launch screen shows the text and the background color correctly. As soon as I define an image from the asset catalogue for the UIImageView in the launch screen, the launch screen is completely black not showing anything. I tried also with a simple png image-set instead of the SVG image, but still the same issue. How can I implement a SVG image in my launch screen?
2
0
475
Jul ’24
Asset Symbol Generation - color and image accessors for Asset Catalogs
Hey, in Xcode 16's release notes there is this: Asset catalogs now provide an inspector property for enabling system color and image accessors for generated asset symbols, which allows Swift packages to opt-in to generating these accessors. (113704993) What exactly does this mean? Can we make the generated asset symbols public, so that we can share assets between local swift packages in the project? Unfortunately, I don't see this option in the inspector. I only see "Asset Symbols > Extensions On/Off". Not sure what that means, either. Thanks
1
4
633
Sep ’24