ld: framework not found QorumLogs for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm getting this in my test files which used to work for months now. This is my header in the file:
import XCTest
import QorumLogs
#testable import MyAppName
The only thing I've changed recently is, update cocoapods, (QorumLogs is a pod), then installed Smooch.io pod, then for the first time added objective-c bridging header, created some Obj-C files and imported smooch.io framework.
Using Xcode 7.3, what can be the problem?
In your podfile, you should include the framework thats causing problems inside the AppTests as well.
target 'MyApp' do
pod 'FBSDKCoreKit'
end
target 'MyAppTests' do
pod 'FBSDKCoreKit'
end
After this:
Clean
Delete Derived Data
Related
I am trying to add Firebase analytic support to an existing iOS app.
The app was already using CocoaPods to import FMDB, and also has a manual build dependency on TensorFlow C library.
After adding Firebase to my podfile file my build failed with,
"Module 'Firebase' not found"
Podfile
target 'myapp' do
pod 'FMDB'
pod 'Firebase/Analytics'
end
Header Search Paths
$(TENSORFLOW_ROOT) $(TENSORFLOW_ROOT)/tensorflow/contrib/makefile/downloads $(TENSORFLOW_ROOT)/tensorflow/contrib/makefile/downloads/eigen $(TENSORFLOW_ROOT)/tensorflow/contrib/makefile/downloads/protobuf/src $(TENSORFLOW_ROOT)/tensorflow/contrib/makefile/gen/proto $(TENSORFLOW_ROOT)/tensorflow/contrib/makefile/downloads/nsync/public/ $(TENSORFLOW_ROOT)/tensorflow/contrib/makefile/downloads/absl ${PODS_ROOT}/Headers/Public/**
Framework Search Paths
"${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/GoogleAppMeasurement/Frameworks" "${PODS_XCFRAMEWORKS_BUILD_DIR}/FirebaseAnalytics" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement"
Library Search Paths
"${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/GoogleAppMeasurement/Frameworks" "${PODS_XCFRAMEWORKS_BUILD_DIR}/FirebaseAnalytics" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement"
Other Linker Paths
"${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/GoogleAppMeasurement/Frameworks" "${PODS_XCFRAMEWORKS_BUILD_DIR}/FirebaseAnalytics" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement"
Attempt 2
This seems to be fixed by adding $(inherited) to the "Header Search Paths" and "Framework Search Paths", as if these paths are customized they don't seem to pick up the pods without this. Although FMDB was working fine without this.
But this still failed with a later build error,
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIRApp", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1
If I remove the reference to FIRApp in my code, it builds fine.
Attempt 3
Build settings
Add $(inherited) to "Other Linker Flags"
This gives a build error on FMDB now,
ld: library not found for -lFMDB
Attempt 4
Build settings
Add $(inherited) to "Library Search Paths"
This gives a different build error in FMDB
duplicate symbol '_OBJC_IVAR_$_FMResultSet._parentDB' in:
/Users/paphus/Library/Developer/Xcode/DerivedData/Miami-btsjnxdkshhzzmcximegwcbjweif/Build/Intermediates.noindex/Miami.build/Debug-iphonesimulator/Miami.build/Objects-normal/x86_64/FMResultSet-8b2ff65f24dc1207099e1a3d8676b2cd074aac777d9679e86442f90b5f7cd476.o
/Users/paphus/Library/Developer/Xcode/DerivedData/Miami-btsjnxdkshhzzmcximegwcbjweif/Build/Products/Debug-iphonesimulator/FMDB/libFMDB.a(FMResultSet.o)
ld: 49 duplicate symbols for architecture x86_64
Attempt 5
Build Phase
Link Binary with Library,
Seems to be missing FirebaseCore now?
ld: library not found for -lFirebaseCore
I also tried "pod deintegrate" and pod cache clean" and a few other things, no luck.
Did you try setting OTHER_LDFLAGS build settings to $(inherited) flag?
So I gave up on getting the pod to work and instead followed,
https://firebase.google.com/docs/ios/setup#frameworks
downloaded SDK from,
https://firebase.google.com/download/ios
This was way way easier and simple to setup and worked the first time.
Just added the FirebaseAnalytics directory to the project as a group and added the Firebase.h file to the project, that's it. Works.
I have a pod that depends on a static lib (precompiled, source code not available).
In this pod project, i drag and drop the folder containing the ".a" file and some other C, Obj-c files.
When i try to include this pod in an application, Cocoapods copy all that pod files but not the ".a" file.
In the Podspec, im using this to include the precompiled library to my pod
s.ios.vendored_frameworks = 'path/a_staticLib.a'
The line above copy the file in frameworks (Pods folder), this is normal as it is called "vendored_frameworks", but i can't found any solution to work with static library.
the error i have :
ld: framework not found -framework
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thank you.
As said in CocoaPods Podspec documentation, you need to use vendored_libraries for static libraries.
So this line:
s.ios.vendored_frameworks = 'path/a_staticLib.a'
should be:
s.ios.vendored_libraries = 'path/a_staticLib.a'
I had a project that was working fine and I decided to update cocoapods. I ran
pod install after cocoapods updated, and now I'm getting this error:
ld: library not found for -lStripe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I know this is a common cocoapods error/problem. I've scoured the internet for the last 12 hours trying every possible solution. Things I've done:
Made sure I'm opening the workspace
Reinstalled cocoapods
Downgraded cocoapods to a previous version (to 0.33.1)
Ran deintegrate and removed cocoapods
Reinstalled cocoapods again
Made sure Build Active Architecture Only is set to NO on both Pod and Target
Tried many variations for Other Linker Flags (see below for current setup)
My Framework Search Paths and Library Search Paths each start with $(inherited)
Other Linker Flags
$(inherited)
-framework
"CoreGraphics"
-framework
"Foundation"
-framework
"MobileCoreServices"
-framework
"Security"
-framework
"SystemConfiguration"
Sometimes, with the above Linker Flags, if I rerun pod install I get a bunch of arm64 errors which can only be solved by adding this to the linkers:
-l"Pods-Buyer-AFNetworking"
-l"Pods-Buyer-Stripe"
-l"Pods-Buyer-RKNotificationHub"
-l"Pods-Buyer-RKDropdownAlert"
-l"Pods-Buyer-SVProgressHUD"
I've also tried combinations of adding/removing this from the Linker Flags:
-ObjC
-lc++
-all_load
And finally, here's my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
target 'Buyer' do
pod 'AFNetworking', '2.2.1'
pod 'Stripe'
# pod 'PaymentKit'
pod 'RKNotificationHub'
pod 'RKDropdownAlert'
pod 'SVProgressHUD'
# pod 'Reveal-iOS-SDK', :configurations => ['Debug']
end
target 'BuyerTests' do
end
I've also followed all of the steps on the CocoaPods Guides Troubleshooting page (specifically 'Using the CocoaPods Project' > Step 4). That didn't change anything.
Is there anything I'm missing? This is driving me crazy... I'm at wits end. Any advice or things I'm missing would be really appreciated! (Oh and I'm running the latest Xcode version)
Thank you all in advanced!
It's possible use this library with pod install?
My project already uses pod install and when I add this library, crash with:
"(UIImageView+AFNetworking.o) ld: 76 duplicate symbols for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)"
VIMNetworking worked out its Cocoapods issues - see https://github.com/vimeo/VIMNetworking
The Podfile entries that worked for me were
pod 'VIMNetworking', '~>5.4.2'
pod 'VIMVideoPlayer', '~>5.4.2'
and deleting the line for AFNetworking since the VIMNetworking pulls AFNetworking in as a dependecy.
My project start with cocos2d v3 and run smooth. However, when I add AFNetworking to my project,
the problem
"ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)" happen.
I used pod install and pod file is
platform :ios, ‘7.0’
pod 'AFNetworking', '~> 2.0'
during the installing, below messages show out
[!] The abc [Debug] target overrides the HEADER_SEARCH_PATHS build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
[!] The abc [Release] target overrides the HEADER_SEARCH_PATHS build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
so I go to project->target->build setting-> header search paths and put $(inherited) inside, then it can install success.
However, the cocos2d library wasn't call. So I go to Pods.debug.xcconfig and Pods.release.xcconfig to add
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "$(SRCROOT)/$(PROJECT_NAME)/Libraries/kazmath/include" "$(SRCROOT)/$(PROJECT_NAME)/Libraries/Chipmunk/chipmunk/include" "$(SRCROOT)/$(PROJECT_NAME)/Libraries/Chipmunk/objectivec/include"
finally the problem "ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)" still happen.
Are the above steps not correct? Or is there any other way to add cocos2d and AFNetworking together? Thank you.