Buck: asset_catalog dependencies of watch flavor bundles do not work

Created on 21 Apr 2016  路  1Comment  路  Source: facebook/buck

Having a watch extension or watch app apple_bundle that has an asset_catalog dependency causes the build to fail with error:

BUILD FAILED: Couldn't get dependency ':WatchAppExtensionAssetCatalog#iphonesimulator-x86_64' of target ':WatchAppExtension':
Target :WatchAppExtensionAssetCatalog (type apple_asset_catalog) does not currently support flavors (tried [iphonesimulator-x86_64])

Adding the asset catalog to either of the targets will produce the same error. BUCK is setup as:

apple_bundle(
  name = 'WatchAppExtension',
  binary = ':WatchAppExtensionBinary',
  extension = 'appex',
  xcode_product_type = 'com.apple.product-type.watchkit-extension',
  info_plist = 'WatchKit Extension/Info.plist',
  deps = [
    ':WatchApp#legacy_watch',
    ':WatchAppAssetCatalog',
    ':WatchAppExtensionResources',
  ],
)

apple_asset_catalog(
  name = 'WatchAppExtensionAssetCatalog',
  dirs = [ 'WatchKit Extension/Images.xcassets' ],
)

apple_bundle(
  name = 'WatchApp',
  extension = 'app',
  binary = ':WatchAppBinary',
  xcode_product_type = 'com.apple.product-type.application.watchapp',
  info_plist = 'WatchKit App/Info.plist',
  deps = [
    ':WatchAppAssetCatalog',
    ':WatchAppResources',
  ],
)

apple_asset_catalog(
  name = 'WatchAppAssetCatalog',
  dirs = [ 'WatchKit App/Images.xcassets' ],
)

Most helpful comment

Adding the asset_catalog as a dependency of the apple_binary instead of the apple_bundle seems to work however.

>All comments

Adding the asset_catalog as a dependency of the apple_binary instead of the apple_bundle seems to work however.

Was this page helpful?
0 / 5 - 0 ratings