2013-10-20 50 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

相關問題