Cannot install Watch app - ios

When trying to test a Watch app on the Watch, in XCode I get the following warning
Watch App xcodeproj TARGETED_DEVICE_FAMILY contains a value incompatible
with the target type.
Looking at the Device logs, it says:
(Error) WatchKit: validateWatchKitApplicationInfoDictionary, invalid UIDeviceFamily value
What am I missing?

Your Watch Extension should have a TARGETED_DEVICE_FAMILY of iPhone whereas the Watch App target should have TARGETED_DEVICE_FAMILY of 1,4 like this:
I had a similar problem on a project that was created with an Xcode beta. I ended up creating a new test project and going through side by side and comparing all the settings.

Modify Targeted Device Family
Open file PROJECT.xcodeproj in your project folder
Open file project.pbxproj
Replace value of TARGETED_DEVICE_FAMILY: "4" for watchkitextension, "1,4" for watchkitapp
Replace value of "TARGETED_DEVICE_FAMILY[sdk=iphonesimulator*]" = "1,4" for watchkitapp
e.g.

Related

Can't upload .ipa from Xcode 11 - "The Info.plist indicates an iOS app, but submitting a pkg or mpkg"

I have an ios app in flutter and trying to submit app to apple store using Xcode. But getting below error while it starts uploading.
"The Info.plist indicates an iOS app, but submitting a pkg or mpkg"
As per other suggestions, I have checked my minimum version in info.plist and it's 13.
I have also tried to export file but it's not exporting only .ipa file now and exporting multiple files in a folder.
Thanks
This issue commonly caused by LSMinimumSystemVersion. You should remove it from the Info.plist inside of your app. That value is for macOS only.
If that's not the case, then just create a new dummy Xcode project and compare its Info.plist to the one in your project. So, you can notice something unusual.

WatchKit app submission failure; MinimumOSVersion

Submitting WatchKit 1.2 companion app, fails during validation with this error:
ERROR ITMS-90455 "Invalid WatchKit App Bundle. The value '2.1' for the MinimumOSVersion key in info.plist in bundle 'redactedbundlename.watchkitapp' is not supported"
I do cannot find a MinimumOSVersion key in the watch app plist or settings, nor in build settings or plist for the phone app.
The only mention of anything "2.1" related is in my build settings:
Any ideas to diagnose this issue?
Fixed it!
For some reason, you need to change WATCHOS_DEPLOYMENT_TARGET from 2.1 to 2.0.
You can find this in Project Settings -> "Watch App Target" -> Build Settings -> (null) - Deployment -> watchOS Deployment Target
(or just search 2.1 in entire project and it should show up in the results)
I am guessing this is a bug, maybe watchOS 2.1 is still marked as 'beta' in Xcode/iTunes Connect, so that when you try to upload to iTunes Connect it rejects it due to bad version.
This might not do it, but I would try looking at the project settings (OS version) for both the WatchKit extension and WatchKit app to ensure that they are what you want. Click on your project container, then at the top left of the menu with things like "General", "Capabilities", etc. Select all the options on that dropdown list and check the OS version.

Failed to install app error: Invalid Bundle - No Apple Watch Binary

I'm trying to develop an extension of my app for the Apple Watch.
Instead of install the app on the watch, I have this error:
AppName Failed to install AppName, error: Invalid Bundle - No Apple Watch Binary
In my info.plist files...
For the extension, I have:
<key>CFBundleIdentifier</key>
<string>com.mycompany.AppName.watchkitextension</string>
<key>WKAppBundleIdentifier</key>
<string>com.mycompany.AppName.watchkitapp</string>
For the WatchKit app, I have:
<key>CFBundleIdentifier</key
<string>com.mycompany.AppName.watchkitapp</string>
<key>WKCompanionAppBundleIdentifier</key>
<string>com.mycompany.AppName</string>
And for my app, I have:
<key>CFBundleIdentifier</key>
<string>com.mycompany.AppName</string>
Did I miss something?
This error plagued me for about 7 hours then I restarted my watch out of desperation and the error went away.
I was plagued with this error for hours. For me, the problem was that my WatchKit Extension's Deployment Target was set to an iOS version higher than my phone's. I simply changed it to match my device's version and it worked perfectly.
For me the problem was fixed by adding the watch app to my iOS target's Embed Watch Content section.
I'm using Xcode 7 and watchOS 2.0. It was building fine on the device, but the simulator was giving me this error.
Steps:
Find your iOS target
Click Build Phases
Ensure your watch app (.app) is included in "Target Dependencies" and "Embed Watch Content"
Try explicitly setting the "Executable file" in the WatchKit app's info.plist.
I had changed the name of my executable file and had the same issue.
In my case, none of these solutions worked for me, however I noticed that by default, my WatchKit App required iOS 8.3, and my phone was running iOS 8.2. Updating the OS to 8.3 solved my problem. It may seem like an obvious solution, but I thought I would share for anyone who could share my problem.
In my case, I got it when building app for WatchOS2. I fixed by setting the schemes like this:
The Watch Extension Scheme builds
3 Target: iPhone (2 dependencies) + Extension (no dependencies) + Watch App
Running Extension Scheme on iPhone simulator -> works!
In my case it was an Info.plist configuration error. The Bundle identifier was different to the NSExtension -> NSExtensionAttributes -> WKAppBundleIdentifier.
Setting the same value fixed the error.
Resets of watch/xcode/iphone doesn't help sometimes, as it described in other answer.
One more case to solve this:
This error appears, when I change iPhone language of my iPhone to not English (in my case - Russian) language.
When I set back English - everything start works as usual!
Make sure:
The bundle id of iOS app is prefix of watch app & extension' bundle id.
Value of WKCompanionAppBundleIdentifier in Info.plist of your watch app matches bundle id of your iOS app.
iOS app, watch app & extension should signed by the same cert.
There must be a build phase in iOS app target:
Destination: Products Directory
Subpath: $(CONTENTS_FOLDER_PATH)/Watch
Click +, add your watch app target.
Filling in the Bundle Display name in the info.plist.Default is blank,there will be an alert.(Xcode 7.3)

Error: WatchKit Extension doesn't contain any WatchKit apps.

Verify that the value of WKWatchKitApp in your WatchKit App's Info.plist is set to YES.
After weeks and weeks of investigations i finally found out the problem.
The product name of the Iphone App was the same as the product name of the Watch App.
Once i changed the Product Name of the WatchApp it worked.
go to your targets. Select the watch app target
go to build settings. Search for Product Name
Edit your Product name to be different than the App Target!
Clean and Build. Should Work. Thanks
It seems like this is the default error msg for random stuff on Xcode 7.
All of a sudden I got that error constantly when trying to Archive.
After retracing my steps I've learned that changing the Build Location to Custom - > Relative to WorkSpace is responsible for that error: WatchKit Extension doesn't contain any WatchKit apps..
Setting the Build Location back to Shared Folder -> Build fixed it completely.

Apple Watchkit simulator issue: SPErrorInvalidBundleNoGizmoBinaryMessage

When I open my existing Watchkit app (Xcode 6.2), it compiles correctly, the simulators are launched (iPhone+Watch), followed by the meaningful error:
Error Launching 'xxx Watchkit Extension'
SPErrorInValidBundleNoGizmoBinaryMessage
I have this issue with all simulators (iPhone 5/5S/6/6+ - 38mm/42mm)
Any ideas what the issue can be?
It seems for some reason the application does not want to run on the simulator, even though it used to. The iPhone application included in the same project does run, as do other Watchkit sample applications.
Did you change the bundle ID of your app? If so you may need to manually update the WKAppBundleIdentifier in the WatchKit Extension and also the WKCompanionAppBundleIdentifier in the WatchKit App.
WKAppBundleIdentifier may need to be same to WatchKit App's Bundle Identifier.
Please check WatchKit Extension's info.plist.
NSExtension - NSExtensionAttributes - WKAppBundleIdentifier - xxxxx.watchkitapp
EDIT: Further explanation to clarify...
Under your App target you go to INFO tab and set Bundle Identifier to com.myapp
Then under the WatchKit Extension target you go to INFO tab and set the Bundle Identifier to com.myapp.watchkitextension
Then still under the WatchKit Extension target and still under the INFO tab you set NSExtension > NSExtensionAttributes > WKAppBundleIdentifier to com.myapp.watchkitapp
So one ends with .watchkitextension and the other ends with .watchkitapp
Check Info.plist for "Your App WatchKit Extension" & "Your App WatchKit App". First part of all indentifiers should be same.
In my case problem was in "Your App WatchKit Extension" > NSExtension > NSExtensionAttributes > WKAppBundleIdentifier.
Be sure you are using an 8.3 simulator.
I got this message consistently when using 8.2. Tried everything listed here and struggled with this for hours. Switching to 8.3 resolved it. Ironic, since you must set the deployment target to 8.2 at the moment, but watchkit apps need 8.3 to run I guess...
I checked all bundle identifiers multiple times but couldn't get rid of the issue. Neither did cleaning the build folder work out.
However, I was able to sort it out by turning off Game Center at the Capabilities of my WatchKit Extension.
Turning it on for the iOS host app seems to work fine, but turning it on for the WatchKit Extension results in the SPErrorInvalidBundleNoGizmoBinaryMessage error when attempting to run the WatchKit App in the simulator, while it completes building without any complaints.
I'm developing a game for Apple Watch and was looking forward to support Game Center. It was actually my plan from the very beginning to communicate with the hosting iOS app to do so, but then I saw Game Center listed in the Capabilities of the WatchKit Extension itself, so I expected to be able to deal with it right there. However, as it doesn't seem to work, I'm going to stick to my original plan to support it through the hosting iOS app.
Xcode Version 6.2 (6C131e)
EDIT: Same issue with Xcode Version 6.3 (6D570)
For issues on real devices (not simulator), do everything in this post:
http://blog.jaredsinclair.com/post/117350678170/jareds-code-signing-tips-apple-watch-edition
Most importantly:
All three targets require the following:
a unique app ID for that target a code signing identity (applies to
all targets) a unique provisioning profile for that target.
and make sure that the app ID's are consistent:
Your app IDs will look something like this:
com.company.App-Name
com.company.App-Name.todaywidget
com.company.App-Name.watchkitapp
com.company.App-Name.watchkitextension
If it still doesn't work, manually delete the app from the watch (by holding onto the icon and then hit 'x') and then try again. This was the kicker that did it for me.
The procedure I solved the problem is
Check if WKAppBundleIdentifier and bundle identifier in WatchKit extension and WatchKit App are correct
Delete subfolders of ~/Library/Developer/CoreSimulator/Devices
Delete subfolders of ~/Library/Developer/Xcode/DerivedData
Clean my project
Restart simulator
Run
I've been struggling with this as well. This is what solved my problem on Xcode 7.1 iOS 9.
Just Make sure you follow the naming below for your identifiers:
Target - com.myCompany.myApp
Watchkit app - com.myCompany.myApp.watchkitApp
Watchkit extension -
com.myCompany.myApp.watchkitApp.watchkitextension
The extension should have the identifier of the WatchKit app target + .watchkitextension
I've tried everything posted thus far in this thread but still couldn't get it to work. I resorted to backtrack to the point when it was working and retrace every single action that I've done to figure out at which point it breaks...
As it turned out, the WatchKit App's info.plist file does not like any custom plist entry, at least that is what I've found out in my case. I've added an entry called "MyAppBundlePrefix" and it caused the "Error Launching 'xxx Watchkit Extension' SPErrorInValidBundleNoGizmoBinaryMessage"
I wish XCode would offer a little bit more specific detail for that error but it took me about 5 hours to find it out by brute force way.

Resources