Libraries not found when using CocoaPods with iOS logic tests
I figured this one out by looking at how the main target of my app was receiving settings from the CocoaPods library. CocoaPods includes an .xcconfig file named Pods.xcconfig. This file contains all of the header search paths.
If you look at your project in the project navigator and click the Info tab, you will see your build configurations listed on the top section. If you open the disclosure triangle for your different configurations, you will see Pods listed under your main target. I had to click the drop down and add Pods to the logic test target as well.
I also had to copy the settings of $(inherited)
and ${PODS_HEADERS_SEARCH_PATHS}
from my main target and copy them over to the logic test target under Build Settings/HEADER_SEARCH_PATHS.
Finally, I had to add libPods.a in the Link Binary with Libraries build phase for my logic tests target.
Hope this is able to help someone else.
Libraries from Cocoapod are not found by Xcode compiler
I found a way to fix the problem.
I follow the guide on this site
https://guides.cocoapods.org/using/troubleshooting.html
What fix the problem for me is the step number 5.
I add the Libraries direct to build now and at the moment it works now for me, all builds are working now.
Cocoapods : Library Not found
First line of defense: (Quit Xcode first, which is part of the strategy) :
rm -rf Pods/ Podfile.lock ; pod install
Defensive approach: verify your Podfile. Is it coherent? How about your tools versions? What happens if you create a new Podfile with pod init
? Do you have all targets as expected?
Drastic measure:
Rebuild xcworkspace entirely:
- quit Xcode
- mv project.xcworkspace to a backup location
sudo gem install cocoapods
(get latest)rm -rf Pods/ Podfile.lock ; pod install
Note:
Notice the use of rm -rf Pods/ Podfile.lock ; pod install
instead of pod update
.
cocoapods: library not found for
A few hours later I found that I have to use $(inherit)
flag for 'Library Search Path' . I do not know why it worked in the first computer without with flag.
iOS project builds ok, but when built for test complains for missing cocoa pods lib?
My answer here is what you want:
What you want to use is link_with
from your Podfile
. Something like:
link_with 'MainTarget', 'MainTargetTests'
Then run pod install
again.
The bigger issue is probably that your unit test target isn't dependent on your main target. If you fixed that more like the Xcode template projects you'd be better off in the long run.
COCOAPOD file not found for Xcode unit tests only
Add the pods separately for Target and TargetTests
Make the following changes in POD file
target ‘Target’ do
platform :ios, ‘8.0’
use_frameworks!
pod 'PLCrashReporter'
end
target 'TargetTests' do
platform :ios, ‘8.0’
use_frameworks!
pod 'PLCrashReporter'
end
Go to the Build Settings of TargetTests
and set the value for “Other Linker Flags” as $(inherited)
Do a POD install then do Clean Build Folder and run
xcode simultor - library not found for
Ok,
I went to the Pods project file and saw that "Build Active Architecture Only" is set to Yes on debug but set to No on release... I just set it to No on both and it works...
Error: ld: library not found for -lPods with CocoaPods
Suggest trying the following, that worked for me:
a) Search from 'Library' from the Target Settings view and double-click to inspect the value of Library Search Paths
b) There are two values listed $(inherited)
and $(PROJECT_DIR)/Pods/build/Debug-iphoneos
. Delete the latter.
c) Do a full clean, build & run
d) Run pod install
again. Notice that the entry is not restored.
Related Topics
Color All Occurrences of String in Swift
How to Disable Floating Headers in Uitableview with Uitableviewstyleplain
How to Attach Debugger to iOS App After Launch
Uitabbar Items Jumping on Back Navigation on iOS 12.1
Prevent Dismissal of Modal View Controller in Swiftui
How to Compare Two Nsdate Objects in Objective C
What Describes the Application Delegate Best? How Does It Fit into the Whole Concept
Ios: Custom Permission Alert View Text
What Does the Text Inside Parentheses in @Interface and @Implementation Directives Mean
Swift Override Instance Variables
iOS 13.1 Crash in Avaudio Player
Adding Blur Effect to Background in Swift
Change Color of Back Button in Navigation Bar
How to Retrieve a File Using Wkwebview
Distancefromlocation - Calculate Distance Between Two Points
Add Lefthand Margin to Uitextfield