error: lipo: not files specified when trying to run the project - swift

im getting this error when I compile the project. This only happens to me. My other co-workers doesn't have this issue.
error: lipo: no input files specified
usage: lipo <input_file> <command> [<options> ...]
command is one of:
-archs
-create
-detailed_info
-extract <arch_type> [-extract <arch_type> ...]
-extract_family <arch_type> [-extract_family <arch_type> ...]
-info
-remove <arch_type> [-remove <arch_type> ...]
-replace <arch_type> <file_name> [-replace <arch_type> <file_name> ...]
-thin <arch_type>
-verify_arch <arch_type> ...
options are one or more of:
-arch <arch_type> <input_file>
-hideARM64
-output <output_file>
-segalign <arch_type> <alignment>
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
mv: rename /Users/42427/Library/Developer/Xcode/DerivedData/PROJECTNAME/Build/Products/Debug (UAT)-iphonesimulator/GBM.app/Frameworks/PatronSDK.framework/PatronSDK-merged to /Users/42427/Library/Developer/Xcode/DerivedData/PROJECTNAME/Build/Products/Debug (UAT)-iphonesimulator/GBM.app/Frameworks/PatronSDK.framework/PatronSDK: No such file or directory
The PatronSDK is a framework embed with the project, is not a Pod. I tried to search the specified directory and I realice that one file is missing and its the PatronSDK. That file is automatically created in the project of my co-workers however in my project is missing after the compilation is finished.
I tried to add the file manually into the directory. Do a clean build but have the same result. After compile, the file is missing in the directory.
I also tried to delete the derived data, delete Xcode and installing again, clone again the project in other route but the issue is always the same
Does anyone know how I can resolve this? I'm running out of options

Related

Error in Makefile calling sed with comment character

I'm trying to build lstrip, a Lua utility for compressing Lua source code. I'm trying to build for Lua 5.1.3 on OS X v10.10.3.
I have downloaded and extracted the Lua 5.1.3 source code and modified the Makefile for lstrip to point to this directory. However, when I run make, I get this output:
cc -I/usr/local/src/lua-5.1.3/src -I/usr/local/src/lua-5.1.3/src -O2 -Wall -Wextra -O2 -c -o lstrip.o lstrip.c
lstrip.c:33:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char* argv[])
^
1 warning generated.
sed '/void luaX_next/i#include "proxy.c"' /usr/local/src/lua-5.1.3/src/llex.c > llex.c
sed: 1: "/void luaX_next/i#inclu ...": command i expects \ followed by text
make: *** [llex.c] Error 1
This is what the relevant Makefile command looks like:
llex.c:
sed '/void luaX_next/i#include "proxy.c"' $(LUASRC)/$# > $#
I think that this is because the # in the sed command is being treated like an actual comment, but I'm not sure.
How can I fix the Makefile, or manually run the steps, to get lstrip built?
Full copy of the Makefile follows, in case it matters:
# makefile for lstrip
# change these to reflect your Lua installation (Lua 5.1!)
LUA= /usr/local/src/lua-5.1.3
LUAINC= $(LUA)/src
LUALIB= $(LUA)/src
LUASRC= $(LUA)/src
# no need to change anything below here
CFLAGS= $(INCS) $(WARN) -O2 $G
WARN= -O2 -Wall -Wextra
INCS= -I$(LUAINC) -I$(LUASRC)
LIBS= -L$(LUALIB) -llua -lm
MYNAME= lstrip
MYLIB= $(MYNAME)
T= $(MYNAME)
OBJS= $(MYNAME).o llex.o
TEST= test.lua
all: test
test: $T
$T $(TEST)
$T: $(OBJS)
$(CC) -o $# $(OBJS) $(LIBS)
llex.c:
sed '/void luaX_next/i#include "proxy.c"' $(LUASRC)/$# > $#
llex.o: proxy.c
clean:
-rm -f $(OBJS) core core.* a.out $(MYNAME)
# eof
Hand-build solution:
cp /usr/local/src/lua-5.1.3/src/llex.c .
Hand-edit llex.c to add the line #include "proxy.c" before the line starting with void luaX_next (line 446 for me).
Now run make, which will succeed.
You can find the answer in the sed manual, and it is in the Makefile lines
llex.c:
sed '/void luaX_next/i#include "proxy.c"' $(LUASRC)/$# > $#
Some variable expansion takes place here:
$(LUASRC) is expanded to the variable set above -> $(LUA)/src. Recurse as needed.
$# is replaced with the current target (llex.c)
So this recipe says:
In order to obtain the target llex.c (which will be processed later through other recipes), apply a stream editing command to the file $LUASRC/llex.c and write it to llex.c.
The stream editing command is: look for text "void luaX_next", before printing it, insert line "#include "proxy.c"".
Problem is, the command to do this is not "i" but "i\(newline)", which conflicts with a requirement of Makefiles that recipes must be on a single line.
I suspect that in order to fix your Makefile you need to use a different command than sed; awk can fit the bill although it's a bit more complex.
This line works in Mac OS X and in Linux:
sed '/void luaX_next/{h;s/.*/#include "proxy.c"/;p;g;}' $(LUASRC)/$# > $#

ecpg can't find includes unless executed from the directory containing the source files

ecpg can find EXEC SQL INCLUDE header files just fine when run from the directory containing the source, but not from any other directory.
Here is an illustration. Successful compile:
> ecpg -o dbconnect.c dbconnect.pgc
Missing include parameter so expected to fail:
> cd ..
> ecpg -o src/dbconnect.c src/dbconnect.pgc
src/dbconnect.pgc:28: ERROR: could not open include file "vet_config.h" on line 28
Add ecpg include parameter. Still fails:
> ecpg -I src -o src/dbconnect.c src/dbconnect.pgc
src/dbconnect.pgc:28: ERROR: could not open include file "vet_config.h" on line 28
I've tried specifying the absolute path to the src directory. No improvement.
I'm aware that the -o is not necessary.
I'm using PostgreSQL 9.2. Here is the version information from ecpg:
> ecpg -v -I src -o src/dbconnect.c src/dbconnect.pgc
ecpg, the PostgreSQL embedded C preprocessor, version 4.8.0
EXEC SQL INCLUDE ... search starts here:
src
.
/usr/local/include
/usr/pgsql-9.2/include
/usr/include
end of search list
After days of fruitless research and attempts to debug the code, I finally found the answer here on this page: http://www.postgresql.org/docs/9.2/static/ecpg-preproc.html
My whole problem was that I had the filename enclosed in double quotes. From the documentation:
But when EXEC SQL INCLUDE "filename" is used, only the current directory is searched.
I removed the double quotes, and all is well

How can I find the version number of an iPhone app from the IPA?

We're trying out a new way of specifying version numbers for our app. I'd like to be able to check that the IPAs we're building have the version numbers we want. How do I get the version number out of the IPA?
Note - I'm not asking for a way of finding it from code inside the app; I've got a terminal open and the IPA file is built, and I want to know what to look for inside the IPA file.
Do the below from your terminal
//Unzip the file
unzip YourIPAFile.ipa
//Open payload folder
cd Payload
//Open your .app file
cd yourApp.app
//Open the plist file
open Info.plist
You can find the version under Bundle version key
There's a better way than PlistBuddy and grep:
unzip -d unzipped-ipa MyApp.ipa
defaults read "$(pwd)/MyApp.app/Contents/Info.plist" CFBundleVersion
rm -rf unzipped-ipa
It's worth noting that using defaults read requires an absolute path to your app.
Unzip your ipa file
unzip YourIPAFile.ipa
Following plistBuddy command prints Bundle Version
/usr/libexec/PlistBuddy -c print Payload/NAME.app/Info.plist | grep CFBundleVersion
CFBundleVersion = 1.0
Following plistBuddy command prints BundleVersion String
/usr/libexec/PlistBuddy -c print Payload/NAME.app/Info.plist | grep CFBundleShortVersionString
CFBundleShortVersionString = 1.0
It's in IPA/payload/NAME.app/Info.plist
You can do it without writing and deleting a file by using tar's feature to extract a single file, then streaming the result to standard output and piping it into the plutil command (pl=>property lists). Extra bonus, pipe that to grep, looking for the string "Version" showing only one line past the found pattern.
In the command below, replace YourIPAFile.ipa with the name of the ipa file you want to inspect and YourAppName.app with the name of the bundle executable in the Plist.info file. For me, using flutter, these two values were the same "Runner", but it's essentially the directory in the tar file where the info.plist file is located.
tar -zxvOf YourIPAFile.ipa Payload/YourAppName.app/Info.plist | plutil -convert xml1 -r -o - -- - | grep -A 1 Version
The output is:
x Payload/YourAppName.app/Info.plist
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
--
<key>CFBundleShortVersionString</key>
<string>1.0.5</string>
--
<key>CFBundleVersion</key>
<string>1</string>
--
<key>DTPlatformVersion</key>
<string>14.0</string>
--
<key>MinimumOSVersion</key>
<string>9.0</string>
Or more to the point:
tar -zxvOf YourIPAFile.ipa Payload/YourAppName.app/Info.plist | plutil -convert xml1 -r -o - -- - | grep -A 1 CFBundleVersion
x Payload/YourAppName.app/Info.plist
<key>CFBundleVersion</key>
<string>1</string>
or
tar -zxvOf YourIPAFile.ipa Payload/YourAppName.app/Info.plist | plutil -convert xml1 -r -o - -- - | grep -A 1 CFBundleShortVersion
x Payload/YourAppName.app/Info.plist
<key>CFBundleShortVersionString</key>
<string>1.0.5</string>
I prefer to use ProvisionQL.
https://github.com/ealeksandrov/ProvisionQL
It provides a quick look of the IPA file (touching the IPA file with two fingers and clicking in Quick Look). It shows information like: Name, version, bundle id, device family, provisioning information, certificates, distribution profile, entitlements and more.
Easy and better way is if you could see the details in QuickLook.
Now there is a plugin for quick look which gives you many details.
You must have homebrew installed.
Link to quicklook plugin here.

OpenSSL build script fails when run as a 'run script' phase within Xcode (succeeds outside of Xcode)

I'm attempting to run a script to build OpenSSL for iOS (armv6, armv7 and i386) as a 'run script' phase in Xcode.
The script builds successfully when run from the command line as a stand alone script. The result is a compiled libcrypto.a, libssl.a and include directory with the headers.
However, when I run the script as a run script phase in Xcode, it gets towards the end of make and errors out stating that it couldn't find any symbols referenced from libcrypto.
shlib_target=; if [ -n "" ]; then \
shlib_target="bsd-gcc-shared"; \
fi; \
LIBRARIES="-L.. -lssl -L.. -lcrypto" ; \
make -f ../Makefile.shared -e \
APPNAME=openssl OBJECTS="openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o" \
LIBDEPS=" $LIBRARIES " \
link_app.${shlib_target}
( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto }"; LDCMD="${LDCMD:-/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386}"; LDFLAGS="${LDFLAGS:--isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DTERMIOS -O3 -fomit-frame-pointer -Wall}"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o ${LIBDEPS} )
Undefined symbols for architecture i386:
"_ENGINE_load_gost", referenced from:
_ENGINE_load_builtin_engines in libcrypto.a(eng_all.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
make[2]: *** [link_app.] Error 1
make[1]: *** [openssl] Error 2
make: *** [build_apps] Error 1
I'm almost certain that this is a paths issue, but I can't figure out how to tell Xcode (or the script) which paths to use.
The script, available here, needed to be modified to account for the recent changes to the location of the developer tools with Xcode 4.3 (namely the fact that Developer/ is no longer at the root, but actually inside Xcode.app).
Here's the script for question completeness:
#!/bin/sh
# Automatic build script for libssl and libcrypto
# for iPhoneOS and iPhoneSimulator
#
# Created by Felix Schulze on 16.12.10.
# Copyright 2010 Felix Schulze. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################
# Change values here #
# #
VERSION="1.0.0c" #
SDKVERSION="5.0" #
# #
###########################################################################
# #
# Don't change anything under this line! #
# #
###########################################################################
CURRENTPATH=`pwd`
CURRENTPATH="${CURRENTPATH}/openssl"
set -e
if [ ! -e openssl-${VERSION}.tar.gz ]; then
echo "Downloading openssl-${VERSION}.tar.gz"
curl -O http://www.openssl.org/source/openssl-${VERSION}.tar.gz
else
echo "Using openssl-${VERSION}.tar.gz"
fi
mkdir -p "${CURRENTPATH}/src"
tar zxf openssl-${VERSION}.tar.gz -C "${CURRENTPATH}/src"
rm openssl-${VERSION}.tar.gz
cd "${CURRENTPATH}/src/openssl-${VERSION}"
############
# iPhone Simulator
echo "Building openssl for iPhoneSimulator ${SDKVERSION} i386"
echo "Please stand by..."
export CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386"
mkdir -p "${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk"
LOG="${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk/build-openssl-${VERSION}.log"
./configure BSD-generic32 --openssldir="${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk" > "${LOG}" 2>&1
# add -isysroot to CC=
sed -ie "s!^CFLAG=!CFLAG=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${SDKVERSION}.sdk !" "Makefile"
make >> "${LOG}" 2>&1
make install >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
#############
#############
# iPhoneOS armv6
echo "Building openssl for iPhoneOS ${SDKVERSION} armv6"
echo "Please stand by..."
export CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv6"
mkdir -p "${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv6.sdk"
LOG="${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv6.sdk/build-openssl-${VERSION}.log"
./configure BSD-generic32 --openssldir="${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv6.sdk" > "${LOG}" 2>&1
sed -ie "s!^CFLAG=!CFLAG=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVERSION}.sdk !" "Makefile"
# remove sig_atomic for iPhoneOS
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
make >> "${LOG}" 2>&1
make install >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
#############
#############
# iPhoneOS armv7
echo "Building openssl for iPhoneOS ${SDKVERSION} armv7"
echo "Please stand by..."
export CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv7"
mkdir -p "${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk"
LOG="${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/build-openssl-${VERSION}.log"
./configure BSD-generic32 --openssldir="${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk" >> "${LOG}" 2>&1
sed -ie "s!^CFLAG=!CFLAG=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVERSION}.sdk !" "Makefile"
# remove sig_atomic for iPhoneOS
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
make >> "${LOG}" 2>&1
make install >> "${LOG}" 2>&1
make clean >> "${LOG}" 2>&1
#############
echo "Build library..."
lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv6.sdk/lib/libssl.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/lib/libssl.a -output ${CURRENTPATH}/libssl.a
lipo -create ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv6.sdk/lib/libcrypto.a ${CURRENTPATH}/bin/iPhoneOS${SDKVERSION}-armv7.sdk/lib/libcrypto.a -output ${CURRENTPATH}/libcrypto.a
mkdir -p ${CURRENTPATH}/include
cp -R ${CURRENTPATH}/bin/iPhoneSimulator${SDKVERSION}.sdk/include/openssl ${CURRENTPATH}/include/
echo "Building done."
Even though this is an older post, I think the problem still persist. But I think I found a very simple solution. Just add the following line to the Build-Script, before "Configure" or "make" is called:
export COMMAND_MODE=unix2003
This should do the trick.
It's been logged as an issue on openssl.
Adjust your configure line:
./Configure darwin64-x86_64-cc zlib no-asm no-krb5 shared

Facing lipo error while creating a single fat file

I am trying to create a single .a file which will contain 3 different .a files so that I could share only one .a file. This is the command I am using
lipo -create -output ./libOutput.a ./libInput1.lib ./libInput2.lib ./libInput3.lib
but I am getting this lipo error:
./libInput1.lib and ./libInput2.lib
have the same architectures (i386) and
can't be in the same fat output file
Any idea how to get rid of this?
So this is the second time I have been here. The answer did not fix my problem. What I have found is that this is actually a bug in Xcode. What has happened both times is that I come and find this answer and that is not my problem and then I'm messing around for hours trying to figure out what's going on and the next thing I know Xcode crashes. Open up Xcode again and magic the problem is gone.
So I am adding my answer to help me remember this next time.
A workaround that worked for me (because I couldn't figure out what part of the building process was creating an additional architecture target to the compilation):just remove the architecture from one of the two .a libraries.
First, you can list the architecture with a simple file command:
$ file libwhatever.a
libwhatever.a: Mach-O universal binary with 4 architectures
libwhatever.a (for architecture armv7): current ar archive random library
libwhatever.a (for architecture armv7s): current ar archive random library
libwhatever.a (for architecture arm64): current ar archive random library
libwhatever.a (for architecture i386): current ar archive random library
$ file libfoo.a
libfoo.a: Mach-O universal binary with 2 architectures
libfoo.a (for architecture i386): current ar archive random library
libfoo.a (for architecture x86_64): current ar archive random library
Then, this workaround is just about removing the i386 arch from the first libwhatever.a (which was supposed to be just for arm* arch in my case anyway).
lipo -remove i386 libwhatever.a -output /tmp/libwhatever.a
mv /tmp/libwhatever.a libwhatever.a
and then you can create/merge your .a files without any warning.
I just had that same error message, and it was due to the fact that I had my architecture set to "other" and had typed in arm6. To fix the problem I simply changed my architecture setting to one of the default values, in my case I picked Standard (arm6 arm7). The Architectures setting can be found in your project build settings.
OK, I got it working. Here is my (entire) version of the run script
# Taken from Ray Wenderlich tutorial: http://www.raywenderlich.com/65964/create-a-framework-for-ios
set -e
# If we're already inside this script then die
if [ -n "$RW_MULTIPLATFORM_BUILD_IN_PROGRESS" ]; then
exit 0
fi
export RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1
RW_FRAMEWORK_NAME=${PROJECT_NAME}
RW_INPUT_STATIC_LIB="lib${PROJECT_NAME}.a"
RW_FRAMEWORK_LOCATION="${BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework"
OUTPUT_LOCATION="${HOME}/Desktop"
if [ ! -w ${OUTPUT_LOCATION} ] ; then OUTPUT_LOCATION="${XCS_OUTPUT_DIR}" ; fi
if [ ! -w ${OUTPUT_LOCATION} ] ; then OUTPUT_LOCATION="/tmp" ; fi
if [ ! -w ${OUTPUT_LOCATION} ] ; then echo "Couldn't find anywhere to write! Dying."; exit 1 ; fi
function build_static_library {
# Will rebuild the static library as specified
# build_static_library sdk
xcrun xcodebuild -project "${PROJECT_FILE_PATH}" \
-target "${TARGET_NAME}" \
-configuration "${CONFIGURATION}" \
-sdk "${1}" \
ONLY_ACTIVE_ARCH=NO \
BUILD_DIR="${BUILD_DIR}" \
OBJROOT="${OBJROOT}" \
BUILD_ROOT="${BUILD_ROOT}" \
SYMROOT="${SYMROOT}" $ACTION
}
function make_fat_library {
# Will smash 2 static libs together
# make_fat_library in1 in2 out
xcrun lipo -create "${1}" "${2}" -output "${3}"
}
# 1 - Extract the platform (iphoneos/iphonesimulator) from the SDK name
if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]]; then
RW_SDK_PLATFORM=${BASH_REMATCH[1]}
else
echo "Could not find platform name from SDK_NAME: $SDK_NAME"
exit 1
fi
echo "RW_SDK_PLATFORM is ${RW_SDK_PLATFORM}"
# 2 - Extract the version from the SDK
if [[ "$SDK_NAME" =~ ([0-9]+.*$) ]]; then
RW_SDK_VERSION=${BASH_REMATCH[1]}
else
echo "Could not find sdk version from SDK_NAME: $SDK_NAME"
exit 1
fi
echo "RW_SDK_VERSION is ${RW_SDK_VERSION}"
# 3 - Determine the other platform
if [ "$RW_SDK_PLATFORM" == "iphoneos" ]; then
RW_OTHER_PLATFORM=iphonesimulator
else
RW_OTHER_PLATFORM=iphoneos
fi
echo "RW_OTHER_PLATFORM is ${RW_OTHER_PLATFORM}"
# 4 - Find the build directory
if [[ "$BUILT_PRODUCTS_DIR" =~ (.*)$RW_SDK_PLATFORM$ ]]; then
RW_OTHER_BUILT_PRODUCTS_DIR="${BASH_REMATCH[1]}${RW_OTHER_PLATFORM}"
else
echo "Could not find other platform build directory."
exit 1
fi
echo "BUILT_PRODUCTS_DIR is ${BUILT_PRODUCTS_DIR}"
echo "RW_OTHER_BUILT_PRODUCTS_DIR is ${RW_OTHER_BUILT_PRODUCTS_DIR}"
# remove alias and copy, if it's archive
UNINSTALLED_PRODUCTS_DIRECTORY="${BUILT_PRODUCTS_DIR}/../../IntermediateBuildFilesPath/UninstalledProducts"
if [ -d "$UNINSTALLED_PRODUCTS_DIRECTORY" ]; then
echo "Looks like we're archiving, fixing aliases..."
rm "${BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}"
cp "${UNINSTALLED_PRODUCTS_DIRECTORY}/${RW_INPUT_STATIC_LIB}" "${BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}"
fi
# Build the other platform.
build_static_library "${RW_OTHER_PLATFORM}${RW_SDK_VERSION}"
if [ -d "$UNINSTALLED_PRODUCTS_DIRECTORY" ]; then
echo "Looks like we're archiving, fixing aliases..."
rm "${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}"
cp "${UNINSTALLED_PRODUCTS_DIRECTORY}/${RW_INPUT_STATIC_LIB}" "${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}"
fi
# If we're currently building for iphonesimulator, then need to rebuild
# to ensure that we get both i386 and x86_64
if [ "$RW_SDK_PLATFORM" == "iphonesimulator" ]; then
build_static_library "${SDK_NAME}"
fi
# Join the 2 static libs into 1 and push into the .framework
make_fat_library "${BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}" \
"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}" \
"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}"
# Ensure that the framework is present in both platform's build directories
cp -a "${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}" \
"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework/Versions/A/${RW_FRAMEWORK_NAME}"
# Copy the framework
ditto "${RW_FRAMEWORK_LOCATION}" "${OUTPUT_LOCATION}/${RW_FRAMEWORK_NAME}.framework"
# Copy the resources bundle
ditto "${BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.bundle" \
"${OUTPUT_LOCATION}/${RW_FRAMEWORK_NAME}.bundle"
echo "DONE. ***** FINAL FRAMEWORK AND BUNDLE WERE COPIED HERE: ${OUTPUT_LOCATION} *****"
Go the target YourLibUniversal/Build Phases/Run script
Then look if the script mentions SIMULATOR_DIR_32 and SIMULATOR_DIR_64
If yes, remove theses references and just set one reference SIMULATOR_DIR
I had:
SIMULATOR_DIR_32=${SYMROOT}/${CONFIGURATION}-iphonesimulator-i386
SIMULATOR_DIR_64=${SYMROOT}/${CONFIGURATION}-iphonesimulator-x86_64
...
lipo -create "${DEVICE_DIR}/lib${LIB_NAME}.a" "${SIMULATOR_DIR_32}/lib${LIB_NAME}.a" "${SIMULATOR_DIR_64}/lib${LIB_NAME}.a" -output "${INSTALL_DIR}/lib${LIB_NAME}Universal.a"
I changed it to that:
SIMULATOR_DIR=${SYMROOT}/${CONFIGURATION}-iphonesimulator-x86_64
...
lipo -create "${DEVICE_DIR}/lib${LIB_NAME}.a" "${SIMULATOR_DIR}/lib${LIB_NAME}.a" -output "${INSTALL_DIR}/lib${LIB_NAME}Universal.a"