2013-10-20 48 views
0

这是我第一次尝试创建自定义iOS框架。我试图用这个tutorial来使用xCode创建自定义iOS框架。我已经完成了最后一步(第12步)。在Xcode中构建自定义iOS框架时出错

Step 12: Build Project with Aggregate scheme 

Select Aggregate("UniversaliOS") Scheme 
Select iOS device 
Build Project (⌘-B) 

但构建失败,Shell脚本调用错误:命令/ bin/sh的退出代码为失败1.错误细节是:

ditto: can't get real path for source 
lipo: can't create temporary output file: /Users/pdl/Library/Developer/Xcode/DerivedData/InnerID-iOS-SDK-dgyjuudeootshidhpzlejhbyqvco/Build/Products/InnerID-iOS-SDK-Bundle.framework/InnerID-iOS-SDK-Bundle.lipo (No such file or directory) 
Command /bin/sh failed with exit code 1 

我绝对没有线索什么现在做。有什么建议么?如有必要,我可以提供PhaseScriptExecution转储。

非常感谢您的帮助。

回答

0

你没有为两者编译你的IOSBundle(步骤10),并直接尝试合并iOS模拟器和设备(步骤12)。

第10步基本上在做什么? 它只是为模拟器和设备创建框架,所以出于某种原因,你的构建文件夹变空了,你的脚本无法找到iOS-Simulator和Device两者或任何一个的框架。

快速解决方案: 在步骤12之前再执行一次步骤10,这将创建iOS模拟器框架和设备框架,在为您的聚合方案构建项目之后,这将合并这两个框架。

你可以找到所有三个(IOS的Simulaor,设备,合并)以低于 /用户/ jaym /库/开发商/ Xcode中/ DerivedData/iOSFramework-doeqysadgntrrlguuvcivuhapnlr /编译/产品框架/

你的情况,/ Users/pdl/Library/Developer/Xcode/DerivedData/InnerID-iOS-SDK -dgyjuudeootshidhpzlejhbyqvco/Build/Products/

+0

没有。仍然有相同的错误。 :-( – Patricia

2

这是要使用的正确shell脚本(用于swift)。

CONFIG=Release 

# Step 1. Make sure the output directory exists 
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIG}-universal 
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" 

# Step 2. Build Device and Simulator versions 

codebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration  ${CONFIG} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build 

xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIG} -sdk iphonesimulator -arch x86_64 -arch i386 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build 

# Step 3. Copy the framework structure to the universal folder. Subsequently copy the files of the swiftmodule (in Modules directory) of -iphonesimulator to the swiftmodule of universal framework directory. 

cp -R "${BUILD_DIR}/${CONFIG}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/" 

cp -R "${BUILD_DIR}/${CONFIG}-iphonesimulator/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/" "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule" 

# Step 4. Create universal binary file using lipo and place the combined executable in the copied framework directory 

lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIG}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIG}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}" 

如果您还有任何疑问,你可以看看video tutorial

+0

这会帮助某人,但我没有使用swift,谢谢。:-) – Patricia

相关问题