Invalid bundle structure when submit to AppStore Connect as Frameworks contain .a file

XCode Version: 15.0 (15A240d) macOS version: 13.6 (22G120)

I have an OpenSSL.xcframeworks (headers and .a included for different platforms e.g. iOS, iOS simulator on arm64/x86) included in my xcode project folder: Frameworks. It run without issues on iPhone device or iPhone simulator, however, when submit to AppStore Connect, it fail with

Upload failed with errors: "Invalid bundle structure, ???.a file is in Frameworks directory, but the Swift runtime libraries are the only files permitted in that directory"

How to solve the issue ?

I’m confused by your setup here. A .a file is a static library. Normally such libraries are linked into your executable thus you don’t need to ship the .a file at all. Is there a specific reason you need to ship it?

See An Apple Library Primer for more about the terminology I’m using here.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

It is because I follow instructions in https://github.com/x2on/OpenSSL-for-iPhone on how to make openssl work on iphone and mac M1 xcode simulator.

Hmmm. I’m not able to comment on workflows from other folks but, in general:

  • An XCFramework can contain either a static or dynamic library [1].

  • If it contains a dynamic library, Xcode will embed that dynamic library within your app’s bundle structure [2] to be loaded at runtime.

  • If it contains a static library, Xcode links that static library into your executable and thus the .a file is not needed at runtime.

I suspect you’ve configured Xcode to both link to the static library and embed it in your app’s bundle; that last bit is wrong.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] For iOS the dynamic library has to be within a framework bundle structure, but the same basic process applies.

[2] Unless you’re using the new mergeable libraries feature.

Thanks eskimo, base on your information, I just need to choose 'Do Not Embed' for the OpenSSL.xcframework in 'Frameworks, Libraries, and Embeded Content' will keep my app run on iPhone / M1 simulator and submit without issue to AppStore Connect.

Invalid bundle structure when submit to AppStore Connect as Frameworks contain .a file
 
 
Q