I can't guarantee this will solve your version of this problem. But I finally got mine working.
The guy who said to remove i386 and x86_64 has part of the answer.
In my target, I set the architectures section as follows
Architectures <multiple values>
Debug
Standard Architectures <$(ARCHS_STANDARD)>
Any iOS Simulator SDK <i386 x86_64>
Any iOS SDK <$(ARCHS_STANDARD)>
Release
Standard Architectures <$(ARCHS_STANDARD)>
Any iOS Simulator SDK <i386 x86_64>
Any iOS SDK <$(ARCHS_STANDARD)>
Base SDK <Latest iOS>
Build active Architecture only <No>
Supported Platforms <iOS>
Valid Architectures <armv7 arm64 i386 x86_64>
I then created annother Target. This one an aggregate (File->new->Target->iOS->Other->Aggregate)
I made no changes to the Build settings for this target, left them all default.
In the Build Phases section, I dragged my preexisting target into the "Target Dependencies" section.
In the Run Script section I placed the following.
# define output folder environment variable
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# Step 1. Build Device and Simulator versions
xcodebuild -target MiniZip ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
xcodebuild -target MiniZip ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 2. Create universal binary file using lipo "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a"
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a"
# Last touch. copy the header files. Just for convenience
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/include" "${UNIVERSAL_OUTPUTFOLDER}/"
I was trying to build the MiniZip library as a 4-way fat library, so where my script says "MiniZip", you will obviously put whatever the name of your target happens to be.
And my end result?
Admins-Mac-mini-2:scratch JoeC$ file libminizip.a
libminizip.a: Mach-O universal binary with 4 architectures
libminizip.a (for architecture armv7): current ar archive random library
libminizip.a (for architecture i386): current ar archive random library
libminizip.a (for architecture x86_64): current ar archive random library
libminizip.a (for architecture arm64): current ar archive random library
Success! Well, for me anyway. I hope this solves your problem as well!
Edit: I should give much of the credit to Ray Wenderlich. My script is based on one he posted.