Xcode plugin template cocoapods - xcode

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

Related

Linking to Sqlite in Xcode 7

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.

Error Creating Xcode projects for wxWidgets applications

I am trying to create an Xcode project with wxWidgets applications.
I follow the manual of wxwidgets:
....
-lz -stdlib=libstdc++ -lwx_osx_cocoa_static -Xlinker -dependency_info -Xlinker
....
ld: library not found for -lwx_osx_cocoa_static
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any idea how to fix this?
If I look for the library the name is: "libwx_osx_cocoa_static.a"
Amazing! so simple: I added the library path (to libwx_osx_cocoa_static.a) and compilation succeeded! Add to Library search Pathes: $(WXROOT)/build/osx/build/Debug/

Linker errors when pushing podspec for Cocoapods 0.39.0

Getting a link failure when trying to push the latest Ensembles podspec. The spec is unchanged, but Cocoapods was updated to 0.39.0. Xcode no doubt changed too, which is likely the culprit, but I can't interpret the error.
-> Ensembles (1.4.3)
- ERROR | [Ensembles/Dropbox] xcodebuild: Returned an unsuccessful exit code.
- NOTE | [Ensembles/Dropbox] xcodebuild: clang: error: linker command failed with exit code 1 (use -v to see invocation)
- NOTE | [iOS] [Ensembles/Dropbox] xcodebuild: fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Ensembles.build/Objects-normal/i386/Ensembles (No such file or directory)
- NOTE | [iOS] [Ensembles/Dropbox] xcodebuild: error: cannot parse the debug map for "/var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Release-iphonesimulator/Ensembles.framework/Ensembles": No such file or directory
I'm not sure if a link failure is causing the other errors, or that the lipo error is causing the link failure. I can't find any more info about the linker exit failure.
Anyone have any idea what might cause this, and what a solution could be?
Update
I did manage to find what I think is the root error:
Ld /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Ensembles.build/Objects-normal/x86_64/Ensembles normal x86_64
cd /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/Pods
export IPHONEOS_DEPLOYMENT_TARGET=6.0
... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk -L/var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Release-iphonesimulator -F/var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Release-iphonesimulator -filelist /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Ensembles.build/Objects-normal/x86_64/Ensembles.LinkFileList -install_name #rpath/Ensembles.framework/Ensembles -Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -rpath -Xlinker #loader_path/Frameworks -mios-simulator-version-min=6.0 -Xlinker -objc_abi_version -Xlinker 2 -framework CoreData -fobjc-arc -fobjc-link-runtime -framework CoreData -framework Foundation -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Ensembles.build/Objects-normal/x86_64/Ensembles_dependency_info.dat -o /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Ensembles.build/Objects-normal/x86_64/Ensembles
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_DBRestClient", referenced from:
objc-class-ref in CDEDropboxCloudFileSystem.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It looks like Cocoapods is trying to create a dynamic library, and that is somehow not working with the oldish Dropbox library for the iPhone simulator architectures. Anyone know of changes in this area, and perhaps a way to prevent Cocoapods using dynamic libraries?
I found the problem: It seems that Cocoapods has started building dynamic frameworks instead of static libraries by default. Apparently linking to the old Dropbox pod I am using was a problem.
To use static libraries instead, you just pass --use-libraries to the pod trunk push or pod lib lint command you are running.
pod lib lint command will check the options in *.podspec file. In my case the problem showed like this :
-> MySDK git:(master) ✗ pod lib lint --allow-warnings
-> MySDK (0.0.1)
- WARN | description: The description is shorter than the summary.
- ERROR | [OSX] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- NOTE | [OSX] xcodebuild: clang: error: linker command failed with exit code 1 (use -v to see invocation)
The [OSX] flag showed that pod lib lint command tried to build a project according your *.podspec file but when building the project in OSX platform something wrong happened.
My solution is add the s.platform = :ios, "5.0" in podspec file.
After that, run pod lib lint everything turned OK.

Xcode 6.1 & Cocoapods Integration/Dependency Error - library not found for -lPods-{Pod Name}

I just upgraded to OS 10.10 Yosemite and Xcode 6 and am having trouble getting my iOS app with CocoaPods dependencies to build.
After doing a clean and build I get an Apple Mac-O Linker Error as shown below
Ld /Users/nick/Library/Developer/Xcode/DerivedData/ToWatchList-cesjouowyxujojcvvxsvupagyozc/Build/Products/Release-iphonesimulator/ToWatchList.app/ToWatchList normal i386
cd "/Users/nick/Dropbox/ToWatchList/ToWatchList App"
export IPHONEOS_DEPLOYMENT_TARGET=8.0
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.1.sdk -L/Users/nick/Library/Developer/Xcode/DerivedData/ToWatchList-cesjouowyxujojcvvxsvupagyozc/Build/Products/Release-iphonesimulator -F/Users/nick/Library/Developer/Xcode/DerivedData/ToWatchList-cesjouowyxujojcvvxsvupagyozc/Build/Products/Release-iphonesimulator -F/Users/nick/Dropbox/ToWatchList/ToWatchList\ App/Pods/CrashlyticsFramework -F/Users/nick/Dropbox/ToWatchList/ToWatchList\ App -filelist /Users/nick/Library/Developer/Xcode/DerivedData/ToWatchList-cesjouowyxujojcvvxsvupagyozc/Build/Intermediates/ToWatchList.build/Release-iphonesimulator/ToWatchList.build/Objects-normal/i386/ToWatchList.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-AFNetworking -lPods-AuxRepo -lPods-CrashlyticsFramework -lPods-Reachability -lPods-SSKeychain -lPods-SVProgressHUD -lPods-Tapstream -framework CoreGraphics -framework Crashlytics -framework Foundation -framework MobileCoreServices -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.0 -lz -lPods -Xlinker -dependency_info -Xlinker /Users/nick/Library/Developer/Xcode/DerivedData/ToWatchList-cesjouowyxujojcvvxsvupagyozc/Build/Intermediates/ToWatchList.build/Release-iphonesimulator/ToWatchList.build/Objects-normal/i386/ToWatchList_dependency_info.dat -o /Users/nick/Library/Developer/Xcode/DerivedData/ToWatchList-cesjouowyxujojcvvxsvupagyozc/Build/Products/Release-iphonesimulator/ToWatchList.app/ToWatchList
ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It seems to have something with the OTHER_LDFLAGS (Other Linker Flags) on my project because if I reorder my pods by going to my application target -> Build Settings -> Other Linker Flags and reorder the items on that list, I can get other pods to generate Linker Errors in the same way (so at least it's not a problem with AFNetworking). Cocoapods and Xcode are not generating any other errors or warnings.
So far I've tried:
Updating to the newest version of Cocoapods with: sudo gem update cocoapods
Commenting out all the pods in my podfile, running pod update to clear them all out and then uncommenting them and run pod update to re-download and install all the dependancies.
Deleting my pod folder and lock file then running pod install to reinstall pods from scratch
Unfortunately none of these steps fixed this error, so I'm guessing there is some Build Setting that I need to tweak in my project but I am unsure what to try next.
Double check that you are opening the .xcworkspace file and not the .xcodeproj file, that's a common mistake that can lead to this kind of problems.
To fix this I had to delete libPods.a under Application Targets -> General -> Linked Frameworks and Libraries. It was highlighted in red (meaning unfound) but I didn't need to replace it; simply clearing it was enough.
For me, the problem was that my project's and Cocoapod's build configurations didn't match, which (I think) meant they were looking in different directories for the compiled libraries.
I had the same issue.
My problem was the the 'Build Active Architectures' on my Target and my Pods target did not match up exactly.
After making them identical the issue was resolved.
Go to "Project Target -> Build Settings -> Preprocessing -> Preprocessor Macros". Set "COCOAPODS=1" in all Debug, Integration, Release under "Preprocessor Macros"
Add the following in "Other Linker Flags" under "Project Target"
$inherited
-ObjC
-lc++
-all_load
Had a same issue after upgrading Deployment target from 7.0 to 8.0 and enabling use_frameworks!

Xcode 5 bot fails to build -- framework not found by ld

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.

Resources