I was working on an app I'm trying to create. It includes an Apple Watch paired with an iPhone. I am creating an Info.plist file, but every time I do it, I get either two errors: One saying that multiple commands are creating an Info.plist file. To fix this command, I turned off "Generate Info.plist file" in Build Settings. After I do that, I get a new error: One saying that no command creates an Info.plist file. To fix that, I made sure the target for the Info.plist file is set to my watch. I am going in circles, and I keep getting errors. Can anyone help?
Question about Xcode
I have an app that has an iOS target and a watchOS target.
In the iOS target there's an Info.plist file, which was auto-generated, but has been modified as the app has developed over the years.
The watchOS target also has an Info.plist file, but all it contains is this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict/>
</dict>
</dict>
</plist>
What are you trying to put into an Info.plist file, and which file: the iOS one or the watchOS one?
Here is the structure of a project with a Watch companion app (it was created several years ago, with Xcode 9 or 10 probably and uses WatchKit and not SwiftUI):
I have highlighted the 3 info.plist
- the first is the usual for iOS app, in iOS section (bundle display name is 'MyApp')
- Second in myApp Watch (bundle display name is 'MyApp'). The content is:
- third info.plist in myApp Watch Extension (bundle display name is 'MyApp Watch extension'). Its content is:
Note also infoPlist, which contains some localizations, with keys as CFBundleName, NSCameraUsageDescription
I don't remember how they were created (I think it was automatic when creating watch companion, but you can probably recreate manually).
Hope that helps.
Or, create a new project in Xcode and add a watchOS target, then see how it's structured. This usually fixes project structure issues.