سؤال

after i installed DTCoreText (https://github.com/Cocoanetics/DTCoreText) with Cocoapods i always get an error when i try to run the simulator or device!

ld: warning: directory not found for option '-L/Users/example/Desktop/ios/Pods/build/Release-iphoneos'
ld: warning: directory not found for option '-L/Users/example/Desktop/ios/Pods/build/Debug-iphoneos'
ld: library not found for -lPods-example
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

in my "Link Binary With Libraries" the "libPods" Part is red:

enter image description here

Here are my build Settings:

The Settings of my Project:

enter image description here

The Settings of my Pods:

enter image description here

EDIT:

I´m not exactly sure what was the Problem, but I solved it when i deleted all the DTCoreText and Cocoapods stuff and reeinstalled everything again!

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

Also this may help:

  1. In your main project (not Pods) select the main target
  2. Go to the Build Phases tab
  3. Go to Link Binary with Libraries
  4. Remove the library that is causing the problem (it would probably be in red color)

Make sure you are opening the .xcworkspace file, not the .xcodeproj

In my linked binaries I had both libPods.a and libPods-MyProj.a. I had previously updated my Podfile to have TWO separate targets (to get it compile tests in Swift with bridging), which meant I had to manually delete the old libPods.a dependency.

I've found that $(inherited) was missing from my Other Linker Flags build setting. Applying this option fixed a missing library issue I was seeing.

I found that selecting "Find implicit Dependencies" (under product / edit scheme) will resolve this issue instead of having to add pods as a target.

Look for "Library Search Path" in you target's Build Settings page. change the folder name of Debug from Debug-iphoneos to Debug-iphonesimulator

Make sure the missing pods library gets actually built. To do so, open the Build Scheme

Product > Scheme > Edit Scheme... > Build

add the Pods target and put it before the target that complained about the library missing (in my case this were the UI tests – I just struggled with this for hours...)

There are so many reason caused this problem.

We need to check:

  • Build setting $(inherited)
  • Detect all implicit dependencies
  • .......

Troubleshooting: http://guides.cocoapods.org/using/troubleshooting.html

For me the error was: that the Pods target did not contain the required architecture slice for i386. So i clicked on the Pods project --> Pods-ProjectName target, and in Build Settings, turned Build Active Architecture Only to NO for both Debug and Release. This makes sure both the Simulator and Device slices are built. The simulator uses the i386 architecture, and the actual devices use x86-64. So you have to make sure all dependent targets for all dependent projects are building both, if you want to run on both Simulator and side loading to devices also.

When you use App extension, navigate to the extension target, and filter to Library Search Path, delete the path the compiler warning to you.

Removing armv7 from VALID_ARCHS within Build Settings resolved this issue for me (Xcode 10.3). I was able to submit after having only armv7s, arm64, and arm64e in VALID_ARCHS.

First I ran

sudo rm -r /Library/Developer/CommandLineTools

to remove the command line tools directory. Then I installed command line tools again with

xcode-select --install

This solved the issue for me.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top