Flutter App with WatchOS - Archive Problem

Hi there,

I have a problem archiving a Flutter App containing an Apple WatchOS Target. The WatchOS target is built with the new logic, containing only one app and no Watchkit extension. When I build the app on my iPhone/Simulator everything is working just fine and they can communicate without any problems.

The error occurs when I'm trying to upload my built archive to App Store Connect for Testflight testing purposes. It fails with the error Asset validation failed: "Missing Info.plist value. A value for the key “WKApplication“, or “WKWatchKitApp“ if your project has a WatchKit App Extension target, is required in “Runner.app/Watch/MyWatchOSApp Watch App.app“ bundle. For details, see: https://developer.apple.com/documentation/watchkit/creating_independent_watchos_apps/setting_up_a_watchos_project".

I tried to fix it by adding a info.plist to the WatchOS target, which isn't created initially. By doing so I can not build the Runner App anymore because it fails with "A WatchKit app within this app is not a valid bundle.".

Can anyone help me fix it please?

Thank you!

Greetings

Post not yet marked as solved Up vote post of DevOops Down vote post of DevOops
2.2k views
  • I have the same issue, but I have no idea how to solve it:(

Add a Comment

Replies

@DevOops, did you find a solution to this yet?

Please try this:

  • In Xcode go to your watch target
  • Pick the Build Settings tab
  • Find the "Architectures" section with the "Supported Platforms" entry.
  • Ensure the value for all configurations (expand the key if necessary) is set to watchOS. (I am guessing it is set to iphoneOS for your non-debug configurations)

I have a theory that without explicitly setting it to watchOS for all configurations Xcode is inheriting values that Flutter has configured elsewhere in the project and it's incorrectly using the iPhone values.