0

I am currently developing a framework that is meant to be released and included by clients for submission to the app store.

Currently, I am executing the following

#!/bin/sh

xcodebuild -target MyFramework -sdk iphoneos -configuration Release clean build

xcodebuild -target MyFramework -sdk iphonesimulator -configuration Release clean build

mkdir build/Release-iphoneuniversal

cp -R build/Release-iphoneos/MyFramework.framework build/Release-iphoneuniversal/

cp build/Release-iphonesimulator/MyFramework.framework/Modules/CNVRTagManager.swiftmodule/*  build/Release-iphoneuniversal/MyFramework.framework/Modules/CNVRTagManager.swiftmodule/

lipo build/Release-iphoneos/MyFramework.framework/MyFramework build/Release-iphonesimulator/MyFramework.framework/MyFramework -create -output build/Release-iphoneuniversal/MyFramework.framework/MyFramework

This creates a great little framework that I can include in projects which I can then build for simulator or device. I can archive fine too. Of particular note, I have added the custom build setting

BITCODE_GENERATION_MODE=bitcode

to ensure bit code is included properly.

The problem? Well, here's what happens when I submit the working app to the app store.

ERROR ITMS-90087: "Unsupported Architectures. The executable for CV FreeCell.app/Frameworks/MyFramework.framework contains unsupported architectures '[x86_64, i386]'." ERROR ITMS-90087: "Unsupported Architectures. The executable for CV FreeCell.app/Frameworks/MyFramework.framework contains unsupported architectures '[x86_64, i386]’."

ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'CV FreeCell.app/Frameworks/MyFramework.framework/MyFramework' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version." ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'CV FreeCell.app/Frameworks/CNVRTagManager.framework/MyFramework' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version.”

WARNING ITMS-90080: "The executable 'Payload/CV FreeCell.app/Frameworks/MyFramework.framework' is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables. For more information refer to Technical Q&A QA1788 - Building a Position Independent Executable in the iOS Developer Library." WARNING ITMS-90080: "The executable 'Payload/CV FreeCell.app/Frameworks/MyFramework.framework' is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables. For more information refer to Technical Q&A QA1788 - Building a Position Independent Executable in the iOS Developer Library.

Now I'm tempted to think that I must release one framework for simulator and one for devices. Is that the case? Is there a resource somewhere that I am missing?

Thanks.

Daniel K
  • 1,119
  • 10
  • 20
  • have you found a solution for this issue? I don't want to make the developer strip the binary before upload and I don't want to relase two versions: simulator and device. – UrK Nov 09 '16 at 09:03
  • I used this http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/ – Daniel K Dec 04 '16 at 05:07
  • Regretfully, it did not help me, as the framework I'm building uses its own frameworks. There is no solution for that other than not using "sub-frameworks" – UrK Dec 05 '16 at 10:30

1 Answers1

-1

Best practice is to create a combined framework. One that has support for both Devices and the Simulator.

This process usually involves building the framework for both architectures separately, and then lipo them together.

You can also use a script for this which will take care of the merge for you whenever you build your framework.

This answer here should give you some more guidance on this.

Community
  • 1
  • 1
Beau Nouvelle
  • 6,962
  • 3
  • 39
  • 54
  • I think you missed the point of the question. A combined framework does not seem to be accepted at the App Store. The script I included on the question lipos two frameworks together. – Daniel K Jul 01 '16 at 05:41
  • But I do see that it is ok to release a universal framework and expect the end user to strip the simulator from the fat binary. – Daniel K Jul 01 '16 at 16:36