iOS-Universal-Framework icon indicating copy to clipboard operation
iOS-Universal-Framework copied to clipboard

Doesn't work with XCode 5 due to missing /usr/bin/libtool

Open markltownsend opened this issue 11 years ago • 8 comments

Tried a project that I am working on that this code. The scripts no longer work in XCode 5 because 'libtool' doesn't exist in ../Contents/Developer/usr/bin any longer..

markltownsend avatar Jun 12 '13 03:06 markltownsend

It looks like command line tools don't get installed with Xcode 5. Can you try out this guy's solution?

http://nathancahill.github.io/installing-homebrew-on-mac-osx-mavericks/

kstenerud avatar Jun 12 '13 15:06 kstenerud

The command line tools are installed, they are just done automatically and some tools are just installed in a different directory than what was in previous version of Xcode.

I was able to change the TemplateInfo.plist to point to the right directory for libtool. $DT_TOOLCHAIN_DIR/usr/bin/libtool

I can provide a patch if you would like. Probably would need an if statement checking the Xcode version, but I haven't done that yet.

markltownsend avatar Jun 12 '13 16:06 markltownsend

i'm having the same issue, tried @kstenerud solution but Command Line toools is not installing libtool. @markltownsend TemplateInfo.plist already have that, but the problem is, Where the hell did libtool went?

dvmrmc avatar Sep 19 '13 09:09 dvmrmc

I had this very problem with the Fake Framework. I found a quick fix that probably isn't the best or most complete solution, but it worked.

In Build Phases tab of project settings there are a couple "Run Script" items at the end. Look into one of those to find this chunk of code:

# Build the fat static library binary

echo "Create universal static library"

echo "$PLATFORM_DEVELOPER_BIN_DIR/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"
"$PLATFORM_DEVELOPER_BIN_DIR/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"

I replaced that with the following:

# Build the fat static library binary

echo "Create universal static library"

if [[ "$XCODE_VERSION_MAJOR" = "0500" ]]
then
    echo "$DT_TOOLCHAIN_DIR/usr/bin/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"
    "$DT_TOOLCHAIN_DIR/usr/bin/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"
else
    echo "$PLATFORM_DEVELOPER_BIN_DIR/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"
    "$PLATFORM_DEVELOPER_BIN_DIR/libtool" -static "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${UFW_OTHER_BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -o "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}.temp"
fi 

That code came directory from https://github.com/kstenerud/iOS-Universal-Framework/blob/master/Fake%20Framework/Templates/Framework%20%26%20Library/Fake%20Static%20iOS%20Framework.xctemplate/TemplateInfo.plist

It would probably be wise to update more than just that little chunk of code, but this is what I had time for. I'll try to get a more complete update later.

djschwartz avatar Sep 19 '13 12:09 djschwartz

@djschwartz

This work for me. Thx

LittleLaa avatar Oct 27 '13 07:10 LittleLaa

This work form me in Xcode 5.1.1.

thanks!

priore avatar Jun 20 '14 13:06 priore

This issue occurs in Xcode 6 beta, the if statement needs to be

if [[ "$XCODE_VERSION_MAJOR" = "0500" || "$XCODE_VERSION_MAJOR" = "0600" ]]

however, Xcode 6 supports cocoa touch frameworks natively.

nrbrook avatar Aug 03 '14 23:08 nrbrook

Having a similar issue on XCode 6 (now Gold Master) due to iphone simulator folder (I guess) for the same script: https://github.com/kstenerud/iOS-Universal-Framework/issues/197

loretoparisi avatar Sep 10 '14 00:09 loretoparisi