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

I have the same issue, but I have no idea how to solve it:(

@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.

Is it possible to create a Watch App using Flutter SDK & build it & release/upload in Testflight/Appstore? Please let us know

I just spent a week reading the internet (six times) trying to get a companion watch app to work on my Apple Watch. I finally succeeded, and I want to share some things that may help others avoid a lot of stress.

First, there is a trick to setting up the Target when you first setup your environment. I am doing a combination of Flutter using Cocoapods and Swift (on the watch). Assuming you have your existing Flutter app you need to go to File>New>Target and select WatchOS and then App. That gives you a dialog where you give it a Project Name like MyWatchApp (this is what will be dispayed on the Watch). You will choose the option for adding to existing ios app. You're going to add it to Runner (or what your app name is). Create it. For whatever reason it leaves out one critical setting that if you don't fix it will never deploy to your devices. With your watch target selected go to Build Settings and search for Supported Platforms. If it is empty put watchOS in there. Then go back to the General tab and your watch app should show in Supported Destinations.

I did not have to add this to my Runner/Info.plist to make it work. I saw this in a lot of posts. I think this may have been a technique to migrate from pre Xcode 15 that used the watch Extension Kit.

<key>WKCompanionAppBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>

If you are starting from Xcode 15 I don't think it is necessary.

It's also helpful in testing and local builds to make sure your laptop, phone, and watch are all on the same wifi network and that network is a 2.4 ghz network.

Flutter App with WatchOS - Archive Problem
 
 
Q