How to solve "Bad CFBundleExecutable" validation error with app store and CocoaPods framework

Viewed 418

I'm having several tricky problems with getting my Mac app with CocoaPods to pass validation into the Mac App Store. It works fine running locally but when I validate, it fails with these errors:

App Store Connect Operation Error
Bad Bundle Executable. You must include a valid CFBundleExecutable key in the nested bundle Pods_MSVAPI_macOS [...<stuff>…Contents/Frameworks/MSVAPI.framework/Versions/A/Frameworks/Pods_MSVAPI_macOS.framework] property list file.

App Store Connect Operation Error
Bad CFBundleExecutable. Cannot find executable file that matches the value of CFBundleExecutable in the nested bundle Pods_MSVAPI_macOS [...<stuff>…Contents/Frameworks/MSVAPI.framework/Versions/A/Frameworks/Pods_MSVAPI_macOS.framework] property list file.

(MSVAPI.framework is my own framework that my app uses, which I intend to be cross-platform)

I read this https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleexecutable and it says "For a framework, it's the shared library framework and must have the same name as the framework but without the .framework extension.". So I tried putting "Pods_MSVAPI_macOS" which is the framework name without the .framework in the "Executable" info entry. No luck.

My next attempt to fix this was to remove the target of Pods_MSVAPI_macos because that's not the actual framework - I have two CocoaPods that I'm using, each which creates its own framework bundle. That worked for getting through validation. But when I came to distribute the app, which I tried locally, it crashed with a "resource not found":

Dyld Error Message:
  Library not loaded: @rpath/<podname>.framework/Versions/A/<podname>
  Referenced from: /Applications/<appname>.app/Contents/Frameworks/MSVAPI.framework/Versions/A/MSVAPI
  Reason: image not found

If I try to add the frameworks directly they are greyed out so it appears that they aren't actually being built independently:

enter image description here

How can I make sure that this CocoaPod's framework (and presumably the other one) gets included in the app bundle, and allow MSVAPI.framework to use it?

Alternatively, how can I get past the CFBundleExecutable validation error at the beginning of my question?

Thanks!

0 Answers
Related