WatchKit2 error on Archive - WatchKit App doesn't contain any WatchKit Extensions - app-store-connect

I have this error after Archive of watchkit app.
error: WatchKit App doesn't contain any WatchKit Extensions. Verify that the value of NSExtensionPointIdentifier in your WatchKit Extension's Info.plist is set to com.apple.watchkit.
My Info.plist is like this:
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>WKAppBundleIdentifier</key>
<string>com.company.nomeapp.watchkit</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.watchkit</string>
</dict>
Build and run on device and simulator works correctly.

I ran into this issue recently (though it didn't build correctly), the problem for me ended up being Mach-O Type was set to static
Go to build settings of watchkit app/extension and make sure:
Mach-O Type = Executable

Related

App Launched from Safari Displays: Do you want to allow this page to open "(null)"?

I am writing a Mac OS app in Go/Objective-C. Suffice it to say, I am not using Xcode and have assembled the application bundle by hand. Here is what it's filesystem hierarchy looks like
${APPNAME}.app
Contents
MacOS
${APPNAME} (binary)
Resources
Base.lproj
InfoPlist.strings (text)
Info.plist (text)
The bundle launches fine. Application works as expected. I have a CFBundleURLTypes dictionary in my Plist file which defines a URL scheme for my application.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>${APPNAME}</string>
<key>CFBundleURLSchemes</key>
<array>
<string>zzz</string>
</array>
</dict>
</array>
(Note: ${APPNAME} is something like "MyApp." It is not a Java-style, reverse DNS name string.)
When I click on a link in Safari that uses the zzz:// scheme, I get a message that says:
Do you want to allow this page to open "(null)"?
Why is that? I have defined my application name in both the Info.plist file and in the InfoPlist.strings file.
The InfoPlist.strings file simply contains this:
CFBundleName = "My Wonderful Application"
There apparently was some sort of caching mechanism happening. When deployed to another Mac system we managed to procure, which never had the software in question installed on it, this problem did not occur.
Note: The previous system which behaved erroneously had, at the beginning of each test, the software completely removed from it. Finder, Safari or some other Apple software must have secretly cached the app name as "(null)".
Answer: Install it on a new Mac machine, or completely restore (with no backup) the machine you are testing with.

Drag and drop of file on app icon doesn't work unless the app is currently running? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do I make an OS X application react when a file, picture, etc is dropped on its dock icon?
For some reason, if I drag and drop a file on my apps icon... it doesn't work unless the app is currently running.
Here is the current Info.plist entry for CFBundleDocumentTypes
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>NSFilenamesPboardType</string>
<key>CFBundleTypeRole</key>
<string>None</string>
</dict>
</array>
Thoughts, opinions, tips, tricks?
Repo here: https://bitbucket.org/crewshin/maketx_dnd
The launching behavior on drag/drop to icon comes from having the file types your application can handle defined in CFBundleDocumentTypes in your Info.plist file.
Your app is not launching because you declared that you do not understand any file type whatsoever.
<key>CFBundleTypeRole</key>
<string>None</string>
To declare your app can read a file type, you should use 'Viewer' or 'Editor' for the CFBundleTypeRole.
The documentation is somewhat unclear about using an * to specify CFBundleTypeExtensions. It used to be a valid way to specify your app can only all file types in 10.4 and earlier, but it may not work after OSX 10.6. Try setting it to an extension you can actually read.

Using preprocessor definitions in iOS App info.plist

I have an iOS app that uses SSO with Facebook as part of getting your app to work with Facebook's SSO you have to specify the FacebookAppId and callback url in the info.plist. I have 2 different Facebook groups one for testing and one for production. I want to be able to have the values of the two keys specified above set based on preprocessor directives.
In my MessageBomb-Prefix.pch i have the following, which works fine:
#ifdef TEST
//Development environments
#define PARSE_APP_ID "dev parse app id"
#define PARSE_CLIENT_ID "dev parse client id"
#define FB_APP_ID "dev facebook id"
#else
//Production environments
#define PARSE_APP_ID "prod parse app id"
#define PARSE_CLIENT_ID "prod parse client id"
#define FB_APP_ID "prod facebook id"
#endif
However in my info.plist i have done the below, but it doesn't seem to work:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fb${FB_APP_ID}</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>${FB_APP_ID}</string>
Is it even possible to do what i'm trying to do. I've set the project to preprocess the info.plist.
Thanks
Peter
If you go into Build Settings you can set Preprocess Info.plist File to YES and then set Info.plist Preprocessor Prefix File to a .h file you've placed in your project with #define directives.
So for example if I add a key to my Info.plist file: testKey with the value TEST_VALUE. Then I place test.h in my project with:
#define TEST_VALUE hello_world
And then I set Preprocess Info.plist File to YES and Info.plist Preprocessor Prefix File to test.h
The value of that key, when retrieved is now "hello_world". If you change the value of the macro a lot you may find you need to do Product/Clean to see changes because XCode seems to cache the compiled value.
To access in plist:
Create a new variable
Define it
Use it in your info plist
The Info.plist preprocessor will let you use build settings in your Info.plist, not #defines. So you can define FB_APP_ID as a custom user build setting in your target (and give it overrides for different schemes), and this value will then be available to Info.plist. However, user build settings don't get exposed to your code. That is, unless you muck with your Preprocessor Definitions build setting and add an entry that looks like
FB_APP_ID=#\"$(FB_APP_ID)\"
(the backslashes are required to get the double-quotes past the shell invocation)
If your app ID may contain spaces, then you'll need to add quotes to get past the shell invocation:
FB_APP_ID="#\"$(FB_APP_ID)\""
In the end, you'll have build settings that looks something like this:

NSDocument app and file extension

I have created a document based app that needs to open xml text files with a particular extension. When I created the project in Xcode using the NSDocument template I specified the extension I wanted and everything was working fine.
Following the Apple guide on how to build document based apps I went to edit the Info.plist file to add the details of the UTI that were missing before. Suddenly my app stopped opening files with the extension I want and in fact stopped opening any file. Also when I try to save a file the save dialog doesn't suggest any extension any more.
When I save a file and run the command mdls from the terminal I get
kMDItemContentTypeTree = (
"public.data",
"public.item"
)
instead of public.xml I set for the UTI in the Info.plist.
It seems that my app stopped recognising the informations stored in the Info.plist. Is there anything I have to connect in Xcode in order to have this working?
Here is the relevant parts of my Info.plist file:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>xmds</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon</string>
<key>CFBundleTypeName</key>
<string>XMDS Script</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>xmds</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.dedalus.degs</string>
</array>
<key>NSDocumentClass</key>
<string>Document</string>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
<key>UTTypeDescription</key>
<string>XMDS Script</string>
<key>UTTypeIconFile</key>
<string>AppIcon</string>
<key>UTTypeIdentifier</key>
<string>com.dedalus.degs</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.apple.ostype</key>
<array>
<string>xmds</string>
</array>
<key>public.filename-extension</key>
<array>
<string>xmds</string>
</array>
</dict>
</dict>
</array>
I used the Project's Target Info setting to set the Document Type and UTI instead of the Info.plist file in Xcode 4.2 and 4.4. This pulls from the Info.plist file and modifies it after you change it. Try using that instead.
The Document Type defines the class that will handle the extension and the extension. The Exported UTIs represent the extensions for which your app is authoritative. See this Stackoverflow question:
What are “Imported UTIs” in Xcode 4?
My Exported UTIs conform to public.data ("Base type for any sort of simple byte stream, including files and in-memory data"). If you use an identifier, make sure it is the same in both the Document Type and Exported UTIs.

Application filetype association icon in Mail.app

I'm writing an OS X application that open files. I've registered for my filetype by using the info.plist as follows:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>My File Type</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>trip</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleTypeIconFile</key>
<string>filetype.icns</string>
</dict>
</array>
In finder I see my icons for my associated filetype and double clicking the file invokes my app perfect.
When I receive a .trip file in Mail.app the icon of the attachment is just the generic one. Double clicking the file does open my application correctly. My icns file contains all the sizes, and was created with Icon Composer.
Is there a way to specify the Mail.app icon? like zip do? have I missed something? or is there a different way of specifying that icon.
Thanks