bazel-ios / rules_ios

Bazel rules for building iOS applications and frameworks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

precompiled_apple_resource_bundle causing AppStore rejection

andre-alves opened this issue · comments

commented

Hello!

My app started getting rejected from AppStore after updating to rules_ios 3.1.0 and rules_apple 3.1.1, with error:

ITMS-90207: Invalid Bundle - The bundle at '/Payload/MyApp.app/AccountStrings.bundle' does not contain a bundle executable.

The Info.plist I provide to precompiled_apple_resource_bundle:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundleVersion</key>
	<string>1.0</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundlePackageType</key>
	<string>BNDL</string>
</dict>
</plist>

Checking the compiled Info.plist inside the .bundle, there is a new key which is probably causing the rejection:

    <key>CFBundleExecutable</key>
    <string></string>

This key doesn't exist when using apple_resource_bundle from rules_apple.

I used rules_ios 2.1.0 and rules_apple 2.5.0 before and never had this issue before.

Do you happen to have a diff/version of the plist with rules_ios 2.1.0?

Looking at the history I cant really see where that value was changed in the 3.0 bump

commented

Old (rules_ios 2.1.0 and rules_apple 2.5.0):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>BuildMachineOSBuild</key>
    <string>22G120</string>
    <key>CFBundleIdentifier</key>
    <string>com.myapp.resource.AccountStrings</string>
    <key>CFBundleName</key>
    <string>.bundle</string>
    <key>CFBundlePackageType</key>
    <string>BNDL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSupportedPlatforms</key>
    <array>
      <string>iPhoneOS</string>
    </array>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>DTCompiler</key>
    <string>com.apple.compilers.llvm.clang.1_0</string>
    <key>DTPlatformBuild</key>
    <string>21A325</string>
    <key>DTPlatformName</key>
    <string>iphoneos</string>
    <key>DTPlatformVersion</key>
    <string>17.0</string>
    <key>DTSDKBuild</key>
    <string>21A325</string>
    <key>DTSDKName</key>
    <string>iphoneos17.0</string>
    <key>DTXcode</key>
    <string>1500</string>
    <key>DTXcodeBuild</key>
    <string>15A240d</string>
    <key>MinimumOSVersion</key>
    <string>17.0</string>
    <key>UIDeviceFamily</key>
    <array>
      <integer>1</integer>
      <integer>2</integer>
    </array>
  </dict>
</plist>

New (rules_ios 3.1.0 and rules_apple 3.1.1):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>BuildMachineOSBuild</key>
    <string>22G120</string>
    <key>CFBundleExecutable</key>
    <string></string>
    <key>CFBundleIdentifier</key>
    <string>com.myapp.resource.AccountStrings</string>
    <key>CFBundleName</key>
    <string>.bundle</string>
    <key>CFBundlePackageType</key>
    <string>BNDL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSupportedPlatforms</key>
    <array>
      <string>iPhoneOS</string>
    </array>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>DTCompiler</key>
    <string>com.apple.compilers.llvm.clang.1_0</string>
    <key>DTPlatformBuild</key>
    <string>21A325</string>
    <key>DTPlatformName</key>
    <string>iphoneos</string>
    <key>DTPlatformVersion</key>
    <string>17.0</string>
    <key>DTSDKBuild</key>
    <string>21A325</string>
    <key>DTSDKName</key>
    <string>iphoneos17.0</string>
    <key>DTXcode</key>
    <string>1500</string>
    <key>DTXcodeBuild</key>
    <string>15A240d</string>
    <key>MinimumOSVersion</key>
    <string>17.0</string>
    <key>UIDeviceFamily</key>
    <array>
      <integer>1</integer>
      <integer>2</integer>
    </array>
  </dict>
</plist>

The only difference is the new key:

    <key>CFBundleExecutable</key>
    <string></string>

Although it seems like the key shouldn't be included because we set this to None in the rule: https://github.com/bazel-ios/rules_apple/blob/b43c7f60b584d68d7d187c236d4328162ba2e806/apple/internal/resource_actions/plist.bzl#L278

Seems like we have custom logic for this that might need to be fixed up:

# Process the plist ourselves. This is required because
# include_executable_name defaults to True, which results in iTC rejecting
# our binary.
output_plist = ctx.actions.declare_file(
paths.join("%s-intermediates" % ctx.label.name, "Info.plist"),
)

Nice find, can you try this branch @andre-alves: #801

commented

Sure, thanks for the quick response @luispadron!

I will try submitting it to AppStore using your branch.

Could you try just checking the plist changes if you get a chance, that might be faster.

commented

Confirmed, CFBundleExecutable is no longer added.

Thank you!

Sweet, I'll merge and release a patch version. Thanks for reporting and following up

commented

AppStore finished processing, all good as well!