Info.plist may not contain the UIRequiredDeviceCapabilities key - xcode

When I try to upload my iOS + apple watch app to iTunes using Application Loader, I get the error message
ERROR ITMS-90595: "Unsupported Key. The Info.plist of bundle Watchless.app/Watch/WatchlessWatchApp.app/PlugIns/WatchlessWatchApp Extension.appex may not contain the UIRequiredDeviceCapabilities key."
Info.plist contains
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>healthkit</string>
</array>
which I think is absolutely necessary because both, watch app and iOS app depend heavily on HealthKit.
The entry is generated when I turn on the HealthKit capability of the watch extension target.
I am running out of ideas what to change.
Using XCode 7.2, Application Loader 3.4

UIRequiredDeviceCapabilities are just your way of saying "I don't want to be installed on device without this functionality".
Removing this will not affect your Watch extension using HealthKit.
Just remove the UIRequiredDeviceCapabilities from the plist in your extension and it should be fine.

Related

Application's iCloud drive folder doesn't show in macOS

I have an app that needs to store video files in it's own container folder in iCloud Drive. I have tried suggestions from most forums and I still couldn't resolve this issue.
These are the things I did to setup a cloud container for my app -
Added iCloud capability. Selected 'iCloud Documents' for Services and selected the appropriate iCloud container that I had created through my developer account.
Added the following entry in Info.plist
<key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.com.TeamName.AppName</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerName</key>
<string>AppName</string>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>Any</string>
</dict>
</dict>
These are the values in the entitlement file
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.TeamName.AppName</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.com.TeamName.AppName</string>
</array>
Have tried with new bundle identifiers and cloud containers.
Have tried updating the Version and the Build value
The app folder is created at '/Users/{user}/Library/Mobile\ Documents/iCloud~com~TeamName~AppName/Documents' and I can see the files I've written to it.
I can find these files at iCloud -> Manage Storage -> AppName on my iPhone too.
Will 'NSUbiquitousContainerIsDocumentScopePublic' be accepted as true only when an app is released on the Appstore? Or it's just that I'm missing something here?
Same here, I followed every tip I could find here and on other websites, but still the folder / files are not showing up visibly.
Problem: ubiquitous container works, files can be read and written, but are not showing up in macOS Finder, nor in the Files app on iOS devices.
macOS 11.5, iOS 14.7, Xcode 12.5.1
I have tried:
everything stated here: https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/FileProvider.html
everything stated here: https://developer.apple.com/library/archive/qa/qa1893/_index.html
every variation of info.plist values for NSUbiquitousContainers (eg. both the container id and my bundle id)
every variation of info.plist values for NSUbiquitousContainerIsDocumentScopePublic
every variation of info.plist values for NSUbiquitousContainerName
every variation of info.plist values for NSUbiquitousContainerSupportedFolderLevels
creating new containers
changing the apps' version and build numbers, including only increasing CFBundleShortVersionString.
changing the apps' bundle identifier
deleting and reinstalling the app
reboots of used devices
switching off/on iCloud drive for the user on all devices
It is driving me crazy. Who can help?

Code Signing an Automator Workflow file within macOS app bundle

I am attempting to upload a macOS binary to the Mac App Store via the Xcode Organizer.
I get an "Upload failed" error with the message:
App Store Connect Operation Error
ERROR ITMS-90276: Missing Bundle Identifier. The application bundle contains a tool or framework workflow [com.company.AppName.pkg/Payload/AppName.app/Contents/Resources/Resources/Scripts/workflow.workflow] that is missing the bundle identifier in its Info.plist file.
My app bundle contains AppleScript.scpt, ShellScript.sh, and workflow.workflow scripting files.
What kind of scripts need Info.plist and Bundle Identifiers for signing? How can I get past this error?
Apple requires that all bundled executables be code signed
What to Code Sign
You sign all the individual components of your app, leaving no gaps, including:
Nested code. First, you recursively sign all of the helpers, tools, libraries, frameworks, and other components that your app relies on, and that are bundled with your app.
https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-SW2
In this case, the workflow.workflow Automator Workflow bundle is failing code signature because it is missing a Bundle Identifier in its existing Info.plist.
I added the lines:
<key>CFBundleIdentifier</key>
<string>com.company.AppName.SampleWorkflow</string>
after adding the BundleID, the Xcode Organizer signs and uploads to the Mac App Store without issue.

iOS8 crash when try to use UIDocumentMenuViewController

I use Xamarin.Forms to create iOS app and I use UIDocumentMenuViewController to Access iCloud file.
When I run program on iOS9+ program is run normally, But when I try my program with iOS8 emulator program is crash on
new UIDocumentMenuViewController(allowedUTIs, UIDocumentPickerMode.Import);
and message is saying
'Application initializing document picker is missing the iCloud entitlement. Is com.apple.developer.icloud-container-identifiers set?'
What wrong with my app and how can I fix this?
Thank you in advance.
You need to make sure that you have enabled the iCloud Entitlements as described here.
This is even mentioned in the official iOS documentation:
Before your app can use the document picker, you must turn on the iCloud Documents capabilities
If you haven't done so already, simply create a new Entitlements.plist file in the root of your project. Then simply enable the iCloud option.
Check that you have linked Entitlements.plist to your project...
I dont know why, but by default Entitlements.plist is not linked, you can do the same by going to option of project and assign custom Entitlement like this!

Safari Extension Companion is always null

I am developing a Safari Extension for my local Mac App, I want to use SafariExtension Companion to communicate between them.
However, in my Global.html of the extension, whenever I am trying to get safari.extension.companion, it is always null. Do I setup the extension wrong?
Besides, according to the guide, I can use safari.extension.addEventListener to listen the message from local app, however, when I debug the extension, it prompts me safari.extension.addEventListener is undefined, why is that?
Answer: safari.application.addEventListener is correct, Apple write a wrong document.
I do setup the exact Companion Bundle Identifier in Extension Builder as the identifier which I set in Xcode for the safari companion according to the guide. Is there anything else I miss? Please help!!!
A Safari extension companion is a type of a MacOS X app extension. Those are shipped as part of application bundles. When the app is installed (the bundle is copied to Applications), Safari picks up the extension.
First, you need an Xcode project with a target of type "Cocoa application" ("Command line tool" won't do). Then you need to create a target of type "Safari Extension Companion", and you have a chance to specify the primary app while creating it.
When you build and archive the app, and export the archive, you get an option to add the extension to the app bundle. Then install the app bundle.
Make sure the bundle ID of the extension matches the setting in the Safari Extension Builder. Also, make sure the app and the Safari extension are both signed, and the keys have matching developer IDs. For certificate type on MacOS X, choose "Developer ID" - first when requesting, then when exporting the bundle from the build archive.
EDIT: when the native companion crashes, Safari quietly disables it. If you remove and reinstall the app bundle, and also restart Safari, it loves the companion again.

Control other app in my app(in sandbox)

I want to miniaturize the Finder in my app, so I use ScriptingBridge to control the Finder.
But, when my app is in the sandbox, it fails to run.
I added com.apple.security.scripting-targets in the sandbox entitlements. Here is the code
<key>com.apple.security.scripting-targets</key>
<key>com.apple.finder</key>
<array>
<string>com.apple.finder.compose</string>
</array>
Finder does not have any scripting access groups. You could add the temporary exception com.apple.security.temporary-exception.apple-events as documented here.
To find scripting targets see here: How can I know the Apple Event Access Groups used by an application?
If you'd like to distribute your app in App Store, however, you're out of luck. By scripting Finder, your app will not pass the review into the App Store.

Resources