Solving the iTunes Connect ITMS-90502 UIRequiredDeviceCapabilities error

From yesterday (22 Feb 2018), it appears iTunes Connect made a change when uploading your builds from Xcode, now ensuring all targets explicitly specify ARM64.

In other words, the Info.plist files for your iOS targets need to contain the following:

<key>UIRequiredDeviceCapabilities</key>
<array>
    <string>arm64</string>
</array>

If this array includes armv7, you should remove it, since 32-bit apps are no longer supported by the App Store.

This needs to be added to all targets (so if you have a Today Extension or Notification Extension, you need it on these also).

This is pretty straightforward, but even after doing this, I still received the error. I quickly realised this was due the various CocoaPods modules.

The fix for this is to add a post_install script to your Podfile, which automatically inserts the UIRequiredDeviceCapabilities value.

One more wrinkle though: since I have a watchOS target that uses various CocoaPods. They must be excluded, or iTunes Connect will give a ITMS-90503 error instead (saying that it can't include armv7k if arm64 is specified).

I came up with the following, which checks the platform of the target:

target 'Outcast' do
    platform :ios, '11.0'
    use_frameworks!
    
    pod 'A'
    pod 'B'
    pod 'C'
end

target 'Outcast WatchKit Extension' do
    platform :watchos, '4.0'
    use_frameworks!
    
    pod 'D'
    pod 'E'
    pod 'F'
end


post_install do |installer|
    plist_buddy = "/usr/libexec/PlistBuddy"
    
    installer.pods_project.targets.each do |target|
        puts target.name
        
        name = "#{target.platform_name}"
        
        if name == 'ios'
            puts "Updating #{target.platform_name}"
            
            plist = "Pods/Target Support Files/#{target}/Info.plist"
            
            `#{plist_buddy} -c "Add UIRequiredDeviceCapabilities array" "#{plist}"`
            `#{plist_buddy} -c "Add UIRequiredDeviceCapabilities:0 string arm64" "#{plist}"`
        else
            puts "Didn't match #{target.platform_name}"
        end
    end
end

Obviously, your specific pod entries will look different, but also make sure to specify platform for your targets acordingly.

After that, update your pods:

$ pod update

Hopefully when you now upload to iTunes Connect, you'll get around the error.

Update 1

I didn't need to remove any armv7 support from my iOS targets. This is how my build settings look for my main iOS target:

Screen-Shot-2018-02-23-at-11.04.04-am

Update 2

You can manually verify the build before uploading:

  1. In Xcode, Window -> Organizer
  2. Find the build, right-click, "Show In Finder"
  3. Right-click on the xcarchive and select "Show Package Contents"
  4. Navigate to "Products" > "Applications" > "YourApp.app"
  5. Right-click and select "Show Package Contents"

Now check the main Info.plist, then expand Frameworks and check any Info.plist file you find in there.

If you have a watchOS target, go to Watch, and explore the Info.plist files for the watch app, extension and any frameworks to ensure they don't have the arm64 value.