Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
604 views
in Technique[技术] by (71.8m points)

ios - How to prevent SwiftSupport libraries to be included twice

When we export our application, Firefox for iOS, to an .ipa file, the SwiftSupport directory is included twice:

./Payload/Client.app/Frameworks/libswiftCore.dylib
./Payload/Client.app/Frameworks/libswiftCoreAudio.dylib
./Payload/Client.app/Frameworks/libswiftCoreGraphics.dylib
./Payload/Client.app/Frameworks/libswiftCoreImage.dylib
./Payload/Client.app/Frameworks/libswiftDarwin.dylib
./Payload/Client.app/Frameworks/libswiftDispatch.dylib
./Payload/Client.app/Frameworks/libswiftFoundation.dylib
./Payload/Client.app/Frameworks/libswiftObjectiveC.dylib
./Payload/Client.app/Frameworks/libswiftSecurity.dylib
./Payload/Client.app/Frameworks/libswiftUIKit.dylib
./SwiftSupport/libswiftCore.dylib
./SwiftSupport/libswiftCoreAudio.dylib
./SwiftSupport/libswiftCoreGraphics.dylib
./SwiftSupport/libswiftCoreImage.dylib
./SwiftSupport/libswiftDarwin.dylib
./SwiftSupport/libswiftDispatch.dylib
./SwiftSupport/libswiftFoundation.dylib
./SwiftSupport/libswiftObjectiveC.dylib
./SwiftSupport/libswiftSecurity.dylib
./SwiftSupport/libswiftUIKit.dylib

This is from the .ipa file that has been built with a Release profile and exported for App Store Distribution.

Has anyone seen this before? I asked twice on the Apple Developer Forums with no responses.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Unfortunately, IPA size still matters for the AppleWatch, since it throws a validation error if the size is beyond a measly 50 MB limit (with all the bloat included).

Fortunately, setting "Embedded content contains Swift" on the Apple Watch application target to NO reduced the Apple Watch size by 16.5 MB, and thus passing validation.

NOTE: My whole app is written in Swift, with embedded Swift-based framworks. But the code is in the WatchKit extension, not the application!

I already asked on the forums if this solution is appropriate or not, no responses yet .. Also, I already submitted this build to itunes connect, and it has been processing for 30 mins now (sigh). Will post back here, or remove the answer if I faced issues with this approach.

You can see in the screenshot below how the WatchKit app is missing the Frameworks folder in the newer archive, removing 16.5 MB

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...