Project that compiles fine in XCode breaks in AppCode

Hi there,

I just downloaded XCode 2.1.1 and wanted to give it a try. My project (although eveolved in the last months) once compiled fine using AppCode 2.0.
Now, with the latest version, the build stops very early with the following error:

/Users/foo/Library/Caches/appCode20/DerivedData/XXXX-ae2406f5/Build/Products/Debug-iphonesimulator/libXXXXXX.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC

/Users/foo/Library/Caches/appCode20/DerivedData/XXXX-ae2406f5/Build/Products/Debug-iphonesimulator/libYYYYYY.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified, -all_load invalid

Opening XCode and rebuilding it there succedes. Any advice on what is wrong? Ideally, I do not have to change any project files, as they are shared.

Also, I used xcode-select -switch to point to the correct XCode installation, and according to the preference page the correct XCode is used. I have XCode 5.0 DP1 installed, but I'm using XCode 4.6.3 (4H1503).

Thanks,
MikeS

7 comments

Michael,
does clearing build folder (Run | Clean Build Folder) changes anything?
Is your library YYYY dynamic or static? (I presume it is static, since you build for iOS). Does it build correctly for simulator in Xcode as well?

0

Hi Anton,

yes, on XCode it builds successfully on both platforms, iOS and Simulator.

after clearing the build folder, I get an assertion:
2013-07-03 16:55:40.621 xcodebuild[47346:a303]  DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-2110/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:87
Details:  Failed to load dependencies output contents from ``/Users/foo/Library/Caches/appCode20/DerivedData/XXXX-ae2406f5/Build/Intermediates/YYYYYY.build/Debug-iphoneos/YYYYYYDeps.build/StaticAnalyzer/YYYYYY/YYYYYYDeps/normal/armv7/ZZZZZZ.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “ZZZZZZ.d” couldn’t be opened because there is no such file." UserInfo=0x405380700 {NSFilePath=/Users/foo/Library/Caches/appCode20/DerivedData/XXXX-ae2406f5/Build/Intermediates/YYYYYY.build/Debug-iphoneos/YYYYYYDeps.build/StaticAnalyzer/YYYYYY/YYYYYYDeps/normal/armv7/ZZZZZZ.d, NSUnderlyingError=0x40537a5c0 "The operation couldn’t be completed. No such file or directory"}. User info: {
NSFilePath = "/Users/foo/Library/Caches/appCode20/DerivedData/XXXX-ae2406f5/Build/Intermediates/YYYYYY.build/Debug-iphoneos/YYYYYYDeps.build/StaticAnalyzer/YYYYYY/YYYYYYDeps/normal/armv7/ZZZZZZ.d";
NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\"";
}.
Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString *, void (^)(NSString *))
Thread:   <NSThread: 0x4009502c0>{name = (null), num = 19}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
Build failed with 8 errors and 0 warnings in 1 min 28 sec

YYYYYY is a project XXXX depends on.

I then went to delete all of ~/Library/Caches/appCode20, which fixes the assertion, but the error is still the same, for iOS builds as well as simulator builds.

0

Michael,
the assertion should be reported to Apple.

What path is printed by 'xcode-select -print-path' command in terminal?

0

This points to

/Applications/Xcode.app/Contents/Developer

which is version 4.6.3 (4H1503).

0

Michael, I apologize for the delay.

Could you please file a bug report in the tracker, and attch build log (AppCode | Messages tool window, Show Build Log buttin)?
Thank you for your patience and help!

0

Hi Anton,

Unfortunately, I cant share the logs, as they might contain confidential information. However, I found some time to look into this again, and got it to work. There were two issues I know of:

1) The xcconfig file contains the line:
SDKROOT = iphoneos
and is not set in the project file. The build result is then correctly put into
/Users/michschn/Library/Caches/appCode20/DerivedData/XXXX-22633f54/Build/Products/Debug-iphonesimulator
when building for the simulator.

The xcconfig file also specifies in the USER_HEADER_SEARCH_PATHS ${TARGET_BUILD_DIR}/Headers
but looking at the project settings resolved paths, it resolves to
/Users/michschn/Library/Caches/appCode20/DerivedData/XXXX-22633f54/Build/Products/Debug-iphoneos
which is not available unless I would build for the device

Is this a bug or is it wrong to setup the project like this?
i'm able to work around by setting
SDKROOT = iphonesimulator

2) A makefile not only copies the headers to ${TARGET_BUILD_DIR}/Headers, but also to myProjectPath/Generated, where also source generated by j2objc is put. When ${TARGET_BUILD_DIR}/Headers preceeds myProjectPath/Generated in the USER_HEADER_SEARCH_PATHS, XCode does not index the files correctly, as two copies of the same file are found. By reversing the order of search directories, AppCode is now able to index those files.

Thanks,
MikeS

0

Michael,
could you please try the latest AppCode 2.5 EAP build with Xcode 5? Apple has fixed its xcodebuild tool, that AppCode uses to build the projects, and it is very likely, that your problem has also been resolved.

0

Please sign in to leave a comment.