I am trying to set up my first Bot for CI. This bot successfully downloads source tree from git but fails to build application (IOS7, simulator mode) which I can build and run without any problems with regular Xcode 5.0.1 environment.
Particularly Bot fails on ld stage (see excerpt below). As I can suggest from the log file, ld cannot find QuartzCore framework, where CA.. functions are defined.
Compiler found all header files from framework, so, for the first glance path are configured OK, but ld cannot find library itself to link...
I suspect this is a trivial error with permissions or environment settings. Could you please point me where to dig?
Thanks in advance.
Regards,
Vladimir
+++ +++ +++
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Library/Server/Xcode/Data/BotRuns/Cache/c5e74f8f-f2c8-f2c8-9bba-cc3ce564b8fb/DerivedData/Build/Products/Debug-iphonesimulator -F/Library/Server/Xcode/Data/BotRuns/Cache/c5e74f8f-f2c8-f2c8-9bba-cc3ce564b8fb/DerivedData/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Library/Server/Xcode/Data/BotRuns/Cache/c5e74f8f-f2c8-f2c8-9bba-cc3ce564b8fb/DerivedData/Build/Intermediates/SBK.build/Debug-iphonesimulator/SBKTests.build/Objects-normal/i386/SBKTests.LinkFileList -bundle_loader /Library/Server/Xcode/Data/BotRuns/Cache/c5e74f8f-f2c8-f2c8-9bba-cc3ce564b8fb/DerivedData/Build/Products/Debug-iphonesimulator/SBK.app/SBK -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework CoreText -framework SenTestingKit -framework UIKit -framework Foundation -framework CoreData -Xlinker -dependency_info -Xlinker /Library/Server/Xcode/Data/BotRuns/Cache/c5e74f8f-f2c8-f2c8-9bba-cc3ce564b8fb/DerivedData/Build/Intermediates/SBK.build/Debug-iphonesimulator/SBKTests.build/Objects-normal/i386/SBKTests_dependency_info.dat -o /Library/Server/Xcode/Data/BotRuns/Cache/c5e74f8f-f2c8-f2c8-9bba-cc3ce564b8fb/DerivedData/Build/Products/Debug-iphonesimulator/SBKTests.octest/SBKTests Undefined symbols for architecture i386:
"_CATransform3DMakeScale", referenced from: -[MBSwitch showFillLayer:animated:] in MBSwitch.o
"_CGAffineTransformIdentity", referenced from: -[TTTAttributedLabel drawTextInRect:] in TTTAttributedLabel.o
"_CGContextAddLineToPoint", referenced from: -[TTTAttributedLabel drawStrike:inRect:context:] in TTTAttributedLabel.o
"_CGContextAddPath", referenced from:
. . . . [skip ] . . . .
ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
** TEST FAILED **
The following build commands failed:
Ld /Library/Server/Xcode/Data/BotRuns/Cache/c5e74f8f-f2c8-f2c8-9bba-cc3ce564b8fb/DerivedData/Build/Products/Debug-iphonesimulator/SBKTests.octest/SBKTests normal i386 (1 failure)
+++ +++ +++
Solved!
It was really trivial issue.
Xcode bot tries to build all targets included into schema. In my case this is project itself and unit tests target. As tests was not developed yet, this target was not compiled. But bot tries to compile it... So all frameworks, linked to the "main target" should be linked to the test target as well.
Related
I'm following this tutorial here: http://www.techotopia.com/index.php/An_Example_SQLite_based_iOS_8_Application_using_Swift_and_FMDB - unfortunately it's written for Xcode 6, not 7.
I followed these steps up to "Creating and Preparing the SQLite Application Project":
Once the project has been created, the next step is to configure the project to include the SQLite dynamic library (libsqlite3.dylib) during the link phase of the build process. Failure to include this library will result in build errors.
To add this library, select the target entry in the Xcode project navigator (the top entry with the product name) to display the General information panel. Select the Build Phases tab to display the build information. The Link Binary with Libraries section lists the libraries and frameworks already included in the project. To add another library or framework click on the ‘+’ button to display the full list. From this list search for, and then select libsqlite3.dylib and click Add.
...however libsqlite3.dylib is not in the list, so I selected libsqlite3.tbd instead (libsqlite3.0.tbd was also listed, but I didn't select it).
However when I build the project I get this output:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_FMDatabase", referenced from:
type metadata accessor for __ObjC.FMDatabase in Database.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I found this QA which isn't of much help ( Undefined symbols for architecture i386 using libsqlite3.dylib with FMDB Xcode 7 ios9 ) because the solutions offered are to either add libsqlite3.dylib (which doesn't exist, I searched in my filesystem), or to add a reference to libsqlite3.tbd which I have done already.
Here's my linker command (formatted for readability):
Ld build/Debug-iphonesimulator/MyApp.app/MyApp normal i386
cd "/Users/me/src-me/MyApp"
export IPHONEOS_DEPLOYMENT_TARGET=9.2
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-arch i386
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk
-L/Users/(me)/src-me/MyApp/build/Debug-iphonesimulator
-F/Users/(me)/src-me/MyApp/build/Debug-iphonesimulator
-filelist /Users/(me)/src-me/MyApp/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.LinkFileList
-Xlinker
-rpath
-Xlinker #executable_path/Frameworks
-mios-simulator-version-min=9.2
-Xlinker
-objc_abi_version
-Xlinker 2 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator
-Xlinker
-add_ast_path
-Xlinker /Users/(me)/src-me/MyApp/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.swiftmodule
-lsqlite3
-framework ExternalAccessory
-Xlinker
-dependency_info
-Xlinker /Users/(me)/src-me/MyApp/build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp_dependency_info.dat
-o /Users/(me)/src-me/MyApp/build/Debug-iphonesimulator/MyApp.app/MyApp
Do not link to the .tbd file. Just add -lsqlite3 to the Other Linker Flags build setting.
I want to create Xcode plugin, and I choose Xcode Plugin Template from Alcatraz, then i close project add Podfile open workspace and try to build i get ann error every time:
ld: library not found for -lDTXcodeUtils
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is a full output:
Ld /Users/jakubmazur/Library/Application\
Support/Developer/Shared/Xcode/Plug-ins/CreateFilesPlugin.xcplugin/Contents/MacOS/CreateFilesPlugin
normal x86_64
cd /Users/jakubmazur/Developer/CreateFilesPlugin
export MACOSX_DEPLOYMENT_TARGET=10.10
/Users/jakubmazur/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-arch x86_64 -bundle -isysroot /Users/jakubmazur/Desktop/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
-L/Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Products/Debug
-F/Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Products/Debug
-filelist /Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Intermediates/CreateFilesPlugin.build/Debug/CreateFilesPlugin.build/Objects-normal/x86_64/CreateFilesPlugin.LinkFileList
-mmacosx-version-min=10.10 -ObjC -lDTXcodeUtils -lXcodeEditor -fobjc-arc -fobjc-link-runtime -framework AppKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/jakubmazur/Library/Developer/Xcode/DerivedData/CreateFilesPlugin-dmzpluimftctcqhbkndjiknqtjnz/Build/Intermediates/CreateFilesPlugin.build/Debug/CreateFilesPlugin.build/Objects-normal/x86_64/CreateFilesPlugin_dependency_info.dat
-o /Users/jakubmazur/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/CreateFilesPlugin.xcplugin/Contents/MacOS/CreateFilesPlugin
ld: library not found for -lDTXcodeUtils clang: error: linker command
failed with exit code 1 (use -v to see invocation)
Any idea what should i set to do this?
Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :osx
pod "DTXcodeUtils"
Do the following steps. Its a work around.
Remove all the scheme and add by clicking auto create schemes.(The pods schemes will be checked once its recreated, need it checked for working it).
Then remove the scheme file from copy bundle resources(is it shows an error).
Deep clean and run
Its building without any error for me, Not sure whether it shows any run time errors/ exceptions
When I try to build my Xcode project this error comes up:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It is really frustrating because I cannot get rid of it. It shows up in my normal target and my test target. Please help.
The full error is below thanks.
Ld /Users/callumbondy/Library/Developer/Xcode/DerivedData/Dotcha!-ajrirvxbqfcklkfaxgrfgwslckom/Build/Products/Debug-iphonesimulator/Dotcha!.app/Dotcha! normal i386
cd "/Users/callumbondy/Desktop/Desktop/Projects/Dotcha!"
export IPHONEOS_DEPLOYMENT_TARGET=8.2
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -L/Users/callumbondy/Library/Developer/Xcode/DerivedData/Dotcha!-ajrirvxbqfcklkfaxgrfgwslckom/Build/Products/Debug-iphonesimulator -L/Applications/Adobe\ Flash\ CC\ 2014/AIR13.0/lib/aot/stub -F/Users/callumbondy/Library/Developer/Xcode/DerivedData/Dotcha!-ajrirvxbqfcklkfaxgrfgwslckom/Build/Products/Debug-iphonesimulator -filelist /Users/callumbondy/Library/Developer/Xcode/DerivedData/Dotcha!-ajrirvxbqfcklkfaxgrfgwslckom/Build/Intermediates/Dotcha!.build/Debug-iphonesimulator/Dotcha!.build/Objects-normal/i386/Dotcha!.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/callumbondy/Library/Developer/Xcode/DerivedData/Dotcha!-ajrirvxbqfcklkfaxgrfgwslckom/Build/Intermediates/Dotcha!.build/Debug-iphonesimulator/Dotcha!.build/Objects-normal/i386/Dotcha_.swiftmodule -mios-simulator-version-min=8.2 -framework StoreKit -framework iAd -framework GameKit -Xlinker -dependency_info -Xlinker /Users/callumbondy/Library/Developer/Xcode/DerivedData/Dotcha!-ajrirvxbqfcklkfaxgrfgwslckom/Build/Intermediates/Dotcha!.build/Debug-iphonesimulator/Dotcha!.build/Objects-normal/i386/Dotcha!_dependency_info.dat -o /Users/callumbondy/Library/Developer/Xcode/DerivedData/Dotcha!-ajrirvxbqfcklkfaxgrfgwslckom/Build/Products/Debug-iphonesimulator/Dotcha!.app/Dotcha!
ld: warning: ignoring file /Applications/Adobe Flash CC 2014/AIR13.0/lib/aot/stub/libSystem.dylib, file was built for armv7 which is not the architecture being linked (i386): /Applications/Adobe Flash CC 2014/AIR13.0/lib/aot/stub/libSystem.dylib
ld: in '/Applications/Adobe Flash CC 2014/AIR13.0/lib/aot/stub/libobjc.A.dylib', file was built for armv7 which is not the architecture being linked (i386): /Applications/Adobe Flash CC 2014/AIR13.0/lib/aot/stub/libobjc.A.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The library libobjc.A.dylib that you are using don't have an i386 architecture slice. You probably is getting this error when running the app on simulator right?
Compile using a compatible version of your library or try to run on a real device to see if it resolves your problem.
I am trying to implement openssl code I found into my project but I get these linker errors that aren't going away. I checked that the frameworks are properly linked and even included the library and header search paths manually using ../lib and ../include. Despite this the error goes away when I get rid of the Openssl function or any function calls such as EVP_OpenUpdate or EVP_OpenInit. This only if I create and then call the function from my ViewController.h file for some reason.
Here is the log of the error:
Ld /Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos/LineaSSL.app/LineaSSL normal armv7
cd /Users/User/Documents/LineaSSL
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
/iPhoneOS5.1.sdk -L/Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos -L/Users/User/Documents/LineaSSL/../../Desktop/x2on-OpenSSL-for-iPhone-a095890/OpenSSL-for-iOS/lib -L/Users/User/Documents/LineaSSL/../../Downloads/DTDevices-iOS_2012-06-15_v1/Library -L/Users/User/Documents/LineaSSL/OpenSSL-for-iOS/lib -L/Users/User/Documents/LineaSSL/lib -F/Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos -Finclude -Finclude/openssl -filelist /Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Intermediates/LineaSSL.build/Debug-iphoneos/LineaSSL.build/Objects-normal/armv7/LineaSSL.LinkFileList -dead_strip -miphoneos-version-min=4.0 -lcrypto -lssl -framework CoreGraphics -framework ExternalAccessory -framework Foundation -framework UIKit -ldtdev -o /Users/User/Library/Developer/Xcode/DerivedData/LineaSSL-clrggexngizkqqbtcxpnmsciuwag/Build/Products/Debug-iphoneos/LineaSSL.app/LineaSSL
ld: warning: ignoring file /Users/User/Desktop/x2on-OpenSSL-for-iPhone-a095890/OpenSSL-for-iOS/lib/libcrypto.a, file was built for archive which is not the architecture being linked (armv7)
ld: warning: ignoring file /Users/User/Desktop/x2on-OpenSSL-for-iPhone-a095890/OpenSSL-for-iOS/lib/libssl.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
"_rsa_open3", referenced from:
-[ViewController barcodeData:isotype:] in ViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please let me know what I should do in regards to this error.
Thanks in advance.
I had to rebuild the entire project from scratch in order to get it to work. I don't know why I had to do such a thing though.
I know that this question had been asked many times, but every answer seems different. I have built my project and tried to run it, but I get this error:
Ld "/Users/******/Library/Developer/Xcode/DerivedData/Cypher_Bot-dxylepzskcnrtybprtuaotmycjjo/Build/Products/Debug-iphonesimulator/Cypher Bot.app/Cypher Bot" normal i386
cd "/Users/******/Xcode/iOS/Cypher Bot/Universal/Cypher Bot/Cypher Bot"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/********/Library/Developer/Xcode/DerivedData/Cypher_Bot-dxylepzskcnrtybprtuaotmycjjo/Build/Products/Debug-iphonesimulator -F/Users/**********/Library/Developer/Xcode/DerivedData/Cypher_Bot-dxylepzskcnrtybprtuaotmycjjo/Build/Products/Debug-iphonesimulator -filelist "/Users/*******/Library/Developer/Xcode/DerivedData/Cypher_Bot-dxylepzskcnrtybprtuaotmycjjo/Build/Intermediates/Cypher Bot.build/Debug-iphonesimulator/Cypher Bot.build/Objects-normal/i386/Cypher Bot.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework Security -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -o "/Users/********/Library/Developer/Xcode/DerivedData/Cypher_Bot-dxylepzskcnrtybprtuaotmycjjo/Build/Products/Debug-iphonesimulator/Cypher Bot.app/Cypher Bot"
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
objc-class-ref in CryptoMainViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I also get this right below the message above:
What does this mean? What do I do to fix it?
The error means that the linker can't find the class definition for MFMailComposeViewController. That class is defined in the MessageUI framework. Did you add the MessageUI framework to your target? If you don't know how to do that, read this: How to "add existing frameworks" in Xcode 4?