Search code examples
xcodewatchkitcode-signingxcode10code-signing-entitlements

Xcode 10, WatchKit app and distribution error ITMS-90334 with com.apple.wk


I have a project with WatchKit app inside.

It used to work smooth with Xcode 8 and Xcode 9 with automatic signing and distribution. Xcode 10 broke something.

What I have at the moment is this enter image description here

The main point here is "com.apple.wk" It has been added somewhere at the re-signing stage by the organizer as far as I can understand.

I checked my project quadriple and I'm 100% sure it doesn't contain "com.apple.wk" string anywhere.

I switched to manual signing. Created new iOS Distribution certificate. Generated 3 Provision profiles with the correct bundles for app, watch app, watchapp extension. The same error is here.

I tried to clean the project, open\close Xcode, reboot the system. No luck. I'm unable to dilever my IPA to iTunes with the error above.

I tried to export IPA and distribute it with Application Loader. No luck.

The only one place I found "com.apple.wk" string was in packaging log

2018-09-21 06:54:33 +0000  /var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.4mX/Root/Payload/myApp.app/Watch/myApp Watch App.app: replacing existing signature    
2018-09-21 06:54:34 +0000  /var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.4mX/Root/Payload/myApp.app/Watch/myApp Watch App.app: signed app bundle with Mach-O universal (armv7k (33554444:1)) [com.apple.WK]

the same time main app and extension have resigned with the correct bundle ids

2018-09-21 06:54:34 +0000  /var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.4mX/Root/Payload/myApp.app: replacing existing signature
2018-09-21 06:54:34 +0000  /var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.4mX/Root/Payload/myApp.app: signed app bundle with Mach-O universal (armv7 arm64) [com.myAppBundleName]
&
2018-09-21 06:54:33 +0000  /var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.4mX/Root/Payload/myApp.app/Watch/myApp Watch App.app/PlugIns/myApp Watch App Extension.appex: signed bundle with Mach-O universal (armv7k (33554444:1)) [com.myAppBundleName.watchkitapp.watchkitextension]

Any ideas how to deliver my app are greatly appreciated.


Solution

  • There are two options:

    a. Open EACH target of your project and change Architectures to $(ARCHS_STANDARD) ARCHS_STANDARD clean build folder and try to upload as usual. This should allow you to send it automatically via organizer as usual.

    b. If above does not work try next:

    1. Click "Archive" with XCode and get xcarchive file
    2. Open archive in Finder
    3. Start distributing to App Store archive through organizer distribute button
    4. Got the error above
    5. Export created ipa file
    6. Open packaging.log file from the export directory
    7. Search for "com.apple.wk" string to find one
    8. Analyze and play a lot with the codesign request from packaging log here it is

      /usr/bin/codesign '-vvv' '--force' '--sign' 'B5152DB7C8BC97C444D44341275F5E1B3336BA3B' '--entitlements' '/var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.vsk/entitlements3uMHR5' '--preserve-metadata=identifier,flags,runtime' '/var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.vsk/Root/Payload/myApp.app/Watch/myApp Watch App.app'

    9. Figure out that if i remove this '--preserve-metadata=identifier,flags,runtime' and rerun this code in bash all is going well and binary is signed with the correct bundle id and not with this com.apple.wk

    10. Copy this signed embedded (the path you are able to find in this request above) watch app binary into the xcarchive file created on the first step with replacing the old one.
    11. Start distributing it back with organizer to App Store
    12. Voila it has been uploaded.

    Hope it will help someone.