在ios中创建静态库时获取lipo错误

时间:2015-02-24 06:35:46

标签: ios iphone xcode

我正在创建静态库文件。在那里我添加了聚合,我做了以下步骤

1.点击Project Navigator 2.接下来点击UniversalLib(我给出的Aggreagte的名称) 3.Build设置 4.添加构建阶段 5.添加运行脚本,我扩展了运行脚本模块,并编写了以下代码

# define output folder environment variable
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
 
# Step 1. Build Device and Simulator versions
xcodebuild -target ImageFilters ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
xcodebuild -target ImageFilters -configuration ${CONFIGURATION} -sdk iphonesimulator -arch i386 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
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}/"

6.然后我在方案选择下拉列表中选择了聚合目标。

7.我收到以下错误......

fatal error: lipo: can't open input file: /Users/admin/Library/Developer/Xcode/DerivedData/StaticLibrary-frasjhywfplfpoetbcefljbwhqcd/Build/Products/Debug-iphoneos/libStaticLibrary.a (No such file or directory)

cp: /Users/admin/Library/Developer/Xcode/DerivedData/StaticLibrary-frasjhywfplfpoetbcefljbwhqcd/Build/Products/Debug-iphoneos/include: No such file or directory

任何人都可以帮我解决这个问题。我在很多网站上搜索过但我没有找到解决办法。

按照本教程我正在做这个例子.... http://www.raywenderlich.com/41377/creating-a-static-library-in-ios-tutorial

0 个答案:

没有答案