bazelbuild/rules_apple

ios_application with launch xcassets containing pdf images

vakhidbetrakhmadov opened this issue · 4 comments

Hi,

How do i set up launch xcassets with ios_application ?

When trying

ios_application(
...,
launch_images = glob([Launch.xcassets/**]),
)

i get the following error

Error in fail: Expected the xcassets directory to only contain files are in sub-directories with the extension launchimage, but found the following: [
  Launch.xcassets/splash.imageset/Contents.json,
  Launch.xcassets/splash.imageset/light.pdf,
  Launch.xcassets/splash.imageset/dark.pdf

And if i change the extension of splash.imageset to launchimage i get

error: The launch image set "splash" references a file "light.pdf", but that file does not have a valid extension.
error: The launch image set "splash" references a file "dark.pdf", but that file does not have a valid extension.
error: The launch image set "splash" has 2 unassigned children.

Can you test that it works with a PNG image in your structure?

Updated Launch.xcassets like so

$ ls -1 Launch.xcassets
Contents.json
splash.launchimage

$ cat Launch.xcassets/Contents.json
{
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}

$ ls -1 Launch.xcassets/splash.launchimage
Contents.json
logo.png

$ cat Launch.xcassets/splash.launchimage/Contents.json
{
  "images" : [
    {
      "idiom" : "universal",
      "filename" : "logo.png"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}

And still getting

error: The launch image set "logo" has an unassigned child.

FWIW, launch images of this format work for me: mattrobmattrob/bazel-ios-swiftui-template@95558ba

Thank you very much!

Sorry, i actually confused launch_images and thought it's designed for specifically providing assets to launch_storyboard, but those should just go into resources.

I now understand that launch_images is for providing static images displayed on app launch.

The issue can be closed 🙏