Á. Márton
Á. Márton

Reputation: 547

MacOS app, altool validation fails with "Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier"

I have an .app which I want to distribute on the AppStore. The AppStore page is set up. I would like to upload a first build. I create a .pkg file with

 pkgbuild --install-location ~/Applications --component ./AppName.app ./PkgFileName.pkg

This succeeds, and if I run this file created locally it correctly installs in the applications folder. After this I would like to validate this file with altool:

xcrun altool --validate-app -f ./PkgFileName.pkg -t osx -u <my_apple_id> -p @keychain:"altoolpass" 

This fails with the following message:

*** Error: Validation failed for 'PkgFileName.pkg'.
*** Error: Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in ‘PkgFileName.pkg’. Unable to validate your application. (-21017)
 {
    NSLocalizedDescription = "Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in \U2018<app_name>\U2019.";
    NSLocalizedFailureReason = "Unable to validate your application.";
}

I'm stumped by this, because the original .app file contains an Info.plist in .app/Contents/Info.plist, and this file has the CFBundleIdentifier key, and the value is the same as we set up on the AppStore page. Why is it still giving me this error?

Upvotes: 3

Views: 589

Answers (1)

Arthur  Bulakaiev
Arthur Bulakaiev

Reputation: 1384

AFAIK you can't distirbute the pkg via Appstore. The Appstore way is to just download an app to the /Applications folder and run it, that is it. The error you got is because altool is not designed to work with pkg files at all.

Let's say, you need to do some preparations before apps first launch, so you are using pkg for this. You can instead put some checks into the code, and do stuff right from there on first start.

You should be able also to create an app which run pkg from inside its bundle, so called app-installer. But this is not according to the guidelines ofc.

In the end, if you really need pkg, you can distribute it from your own website/other sources (signed and notarized), but not from AppStore.

Upvotes: -3

Related Questions