Kaëris
Kaëris

Reputation: 3384

ld: framework not found Pods

I'm trying to add a framework to my IOS project but when I build I always got the same message :

ld: framework not found Pods

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried to remove my Pods directory and then run pod install I open the .xcworkspace like it is written in the logs on the pod install, I clean the project on xcode and then try to build but it won't works..

My podfile looks like this :

xcodeproj '/Users/guillaume/project/Mobile/iOS/FoodPin/FoodPin.xcodeproj'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftHTTP', '~> 0.9.2'

My version of xcode is 6.3.1

Thank you,

Upvotes: 321

Views: 299123

Answers (30)

Pratik Butani
Pratik Butani

Reputation: 62419

As shown in image, you should open .xcworkspace instead of .xcodeproj

Its basic issue but as a beginner we should know about this.

enter image description here

Upvotes: 2

islam XDeveloper
islam XDeveloper

Reputation: 500

Just close the project and open file -> project.xcworkspace

Upvotes: 0

Alexander Volkov
Alexander Volkov

Reputation: 8407

...and the correct answer is...

When you use pods (Podfile and pod install) it generates and tweaks some of the "Builds Settings" for you. However, sometimes you add something else, e.g.:

  • You modify "Other linking flags" by adding a few more flags
  • or you add extra frameworks manually, etc.

Hence, when you update Podfile so, that the generated project have to change the generated settings again, it skips them.. because you manually tweaked them.

For example, if you removed use_frameworks!, you dependencies should became binary, and they should not be added as frameworks, but if you modified "Other linking flags", it's not updated and keeps flags like -framework CocoaAsyncSocket. And when you build, obviously you don't have this framework anymore - .. and you have "Not found.." issue.

The solution is, to check which settings you tweaked and reset them to defaults. This will allow pod install to update them properly. But, running pod deintegrate and then pod install is not a right solution, because you might miss the manually added settings. Therefore, verify and saved somewhere the settings you modified, reset them (or use pod deintegrate), then pod install and then apply the manual settings back if they still make senses.

Upvotes: 1

ANDYNVT
ANDYNVT

Reputation: 671

framework not found Pods_OneSignalNotificationServiceExtension

In my case (Intel mac), setting the deployment target is the same (11.0) works for me:

  1. pod file

pod file

  1. Runner

CleanShot 2022-12-20 at 22 40 23@2x

  1. One signal extension

CleanShot 2022-12-20 at 22 41 40@2x

Upvotes: 0

Ali Nawaz
Ali Nawaz

Reputation: 2500

In my case I added the new pod entry in pod file using double quote ( pod "xposd" ) which was causing issue. Try adding pod entry using single quotes just like this ( pod 'xpod' ) in your pod file.

Upvotes: 0

David Chanturia
David Chanturia

Reputation: 123

In my case just deleting Pods folder and running pod install solved the issue.

Upvotes: 1

CGN
CGN

Reputation: 589

My solution was

  1. delete the actually via pods removed and still error generating Framework in Xcode Target > Build Settings > Other linking flags (in the section linking)

  2. Close Xcode and after that run pod update

  3. Reopen Xcode and then run Product > Clean Build Folder in the menu

After that my project is running and compiling again!

Upvotes: 0

Akbar Khan
Akbar Khan

Reputation: 2415

I have resolved this issue.

delete these three files.

  1. Podfile.lock
  2. Pods folder
  3. .xcworkspace

Then open your project in terminal and run pod deintegrate command, and after then run pod install command

Upvotes: 5

Ali Qaderi
Ali Qaderi

Reputation: 471

I had the same issue after removing some pods from my project. First I have used pod deintegrate after that pod install in the terminal but didn't work for me. So I went to the second step inside my project Build Setting and on the Other Linker Flags option, I have found that the deleted frameworks are not removed so I removed them manually.

Upvotes: 2

Ram G.
Ram G.

Reputation: 3125

I used step -> go to the build setting of your target, and edit the "Framework Search Path" with "${inherited}", and now problems goes for FBLPromises.framework not found.

Upvotes: 1

torun
torun

Reputation: 480

In my case, I faced this problem because I used non-English character in project name.

Problem solved when I changed the project name and run install pod again.

Upvotes: 0

Alp Altunel
Alp Altunel

Reputation: 3443

If you opened .xcworkspace file and you still got the same error, delete all the contents of Pods directory and from command line write pod install to resolve the issue.

Upvotes: 0

Noah Nuebling
Noah Nuebling

Reputation: 309

For me, the problem was that in my main project, the build setting Build Active Architecture Only was set to NO, and in the Pods project, it was set to YES.

After setting both to be the same, it worked!

Upvotes: 0

pmmlee
pmmlee

Reputation: 11

  1. pod init
  2. close current xcode project
  3. reopen xcode project with the xcworkspace suffix

enter image description here

Upvotes: -3

Dey
Dey

Reputation: 901

in my case, my problem was the following: ld: framework not found UserMessagingPlatform.xcframework

for me, the solution was the following:

  1. open a finder window and go to the ios folder
  2. look for the following files:

Pods-[YOUR PROJECT NAME].release.xcconfig

Pods-[YOUR PROJECT NAME].debug.xcconfig

enter image description here

  1. open those files and remove the following text: -framework "UserMessagingPlatform.xcframework" in both files

Upvotes: 3

Hemant
Hemant

Reputation: 143

[Xcode 11.2.1]

For me it was different app target version in Podfile(platform :ios, '11.0') and in Xcode project file Xcode Deployment info.

It causing Archiving job fail in CI pipeline.

Matching both value fixed an issue! Hope this help anyone.

Upvotes: 11

Ted
Ted

Reputation: 23756

Xcode 9, 10, 11, 11.5

install https://github.com/CocoaPods/cocoapods-deintegrate

pod deintegrate

then

pod install

Upvotes: 163

Yaman
Yaman

Reputation: 1061

In my case, I created the workspace before installing the pods, so when I installed the pods, the workspace included my project only, add the Pods project to your workspace, clean and rebuild solved the issue in my case

Upvotes: 0

Pengguna
Pengguna

Reputation: 4951

It's happened to me because I changed the Deployment Target in General but forgot to change the Deployment Target in Pods > General. Change the deployment target

Upvotes: 14

the.giologist
the.giologist

Reputation: 21

None of the previous answers pointed out the root problem in my situation. So I hope this may be useful to someone else.

In my case I ended up having to edit my podfile at the root of my project. When I first created my podfile, swift static libraries were not supported. So I had been using use_frameworks! in my podfile under each of my targets as such:

BEFORE

...
target 'targetName' do
   use_frameworks!
   pod 'podName', '~> 0.2'
end

AFTER

...
target 'targetName' do
   pod 'podName', '~> 0.2'
end

I removed use_frameworks! from my podfile which kept installing the frameworks every time I ran pod install. After removing this line, make sure to run pod install again and remove any of the red .framework references from your Frameworks folder in Xcode. (Though mine appeared differently as attached below.)

Image of Removing .framework files that are no longer necessary

You can also read more about use_framework! here.

Upvotes: 2

Marina Aguilar
Marina Aguilar

Reputation: 1189

In my case, there was a reference to the library I removed on

Targets > Build Settings > Runpath Search Paths

Removing the library from Podfile and updating it obviously didn't remove it, so I had to do it manually and now everything works.

Upvotes: 2

Alessio Campanelli
Alessio Campanelli

Reputation: 1030

another great things is using this rule to disable the input & output paths of the CocoaPods script phases (Copy Frameworks & Copy Resources):

 install! 'cocoapods',
        :disable_input_output_paths => true

Upvotes: 0

Joseph Francis
Joseph Francis

Reputation: 1231

For me, the problem was about changing the deployment target. I changed it to 9.0+ but changing it to 11.0+ worked.

Upvotes: 1

Please check your Executable file inside .Framework like enter image description here

  1. The executable file name should like this without any extension.

  2. Some frameworks showing like this enter image description here

  3. Using Terminal goto .framework directory use below command lipo -create FrameworkName-x86_64 FrameworkName-armv7 FrameworkName-armv7s FrameworkName-i386 FrameworkName-arm64 -output FrameworkName

after creating single executable file delete this files enter image description here

Upvotes: 0

amirtutunchi
amirtutunchi

Reputation: 310

maybe you suddenly open the wrong file of .xcodprj and you should open .xcworkspace

Upvotes: 1

Swindler
Swindler

Reputation: 810

I tried every answer on here and none of them worked. I ended up getting it working by upping the deployment target from 10.0 to 11.0. I have no idea why that fixed it, but I suspect it has to do with upgrading to Xcode 10.2.1.

Upvotes: 1

Levine Veblen
Levine Veblen

Reputation: 121

This is the way i fix my problem. and it now work when i writing this answer:

Firstly, i try all the most fix way above,

remove Pods_xxx.framework from the link libraries and framework in target's build phases is helpful, and the issue will disappear, but the coming problem is i can't import the Pods.framework anymore.

And Then, i try to reinit the xcworkspace config, so that i can figure out the real problem. so i run

pod deintergate

and then install my pod again:

pod install

this work prefectly, but the problem is still in there, but i figure out the real problem is the Pods_xxx.framworks not be compiled succeed by cocoapods build script. I think this is the true way to fix the problem.

Finally, i try to edit my project's scheme:

Pods scheme is not in edited

and i add Pods scheme into manage:

enter image description here

and build this Pods.framework separately, and you will find the Pods.framework icon become truly again:

enter image description here

and i think now you have fix your "framework not found Pods_xxxx.framework" problem but actually i have another problem coming:

enter image description here

so i go to the build setting, and edit the "Framework Search Path" with "${inherited}", and now all the problems goes out, cheer!!!!:)

enter image description here

Upvotes: 5

Sultan Ali
Sultan Ali

Reputation: 2589

I resolved this by dragging .framework file to the Linked Framework and Libraries

Let say I was having this problem due to error FIRAnalyticsConnector not found and I just drag FIRAnalyticsConnector.framwork file to Linked Framework and Libraries and my problem solved

Upvotes: 0

joels
joels

Reputation: 1312

In my case, after comparing the difference between a branch I knew built correctly, I noticed this line in my Podfile:

platform :ios, '11.0'

I had inadvertently up'd my target version from 10 to 11 while my targets in Xcode remained set to 10. Reverting back to 10 solved my issue for me.

Ensure your target iOS versions are properly set.

Upvotes: 6

AnthoPak
AnthoPak

Reputation: 4391

This issue was driving me crazy as it suddenly happened without doing any changes to the project. I've tried all suggested solutions in this thread (and other related) and none of them solved the problem.

The only thing that differed from my other projects (which compiled fine), was that this project name was containing an accent (a french accent, "é"). I've renamed the project and all related files, and it finally worked !

Maybe this is related to updating to Xcode 10, because this project was working well before...

EDIT : it also seems to failed when using a project with - in project name…

Upvotes: 7

Related Questions