えるまる
えるまる

Reputation: 2551

ld: framework not found after pod install

I added Firebase libraries to my project, and then I got this error. When I compile it, Xcode can't find some directories. However, they are in the Pods directory.

Here is the error log:

ld: warning: directory not found for option '-F/Users/Erumaru/Library/Developer/Xcode/DerivedData/ToDoTogether-gkzytezmbbgkikgoxjpptxgrixil/Build/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: warning: directory not found for option '-F/Users/Erumaru/Library/Developer/Xcode/DerivedData/ToDoTogether-gkzytezmbbgkikgoxjpptxgrixil/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'
ld: framework not found GTMSessionFetcher
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Here is my Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'ToDoTogether' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  platform :ios, '10.0'
    pod 'Firebase'
    pod 'Firebase/AdMob'  
    pod 'Firebase/Auth'
    pod 'Firebase/Crash'
    pod 'Firebase/Database'
    pod 'Firebase/Analytics'
    pod 'Firebase/Messaging'
    pod 'Firebase/RemoteConfig'
    pod 'Firebase/Storage'

  # Pods for ToDoTogether

end

Upvotes: 16

Views: 23025

Answers (6)

Abdul Karim Khan
Abdul Karim Khan

Reputation: 4935

On Xcode 15.0, I was able to solve this by adding below code by the end of podfile.

post_install do |installer|
   installer.pods_project.targets.each do |target|
   target.build_configurations.each do |config|
   config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
  end
end

This hook allows you to make any last changes to the generated Xcode project before it is written to disk, or any other tasks you might want to perform. In our case it's setting excluded architecture -> "arm64".

PS: I tried excluding from build setting but it didn't worked. After adding above mentioned code in Podfile, I was able to compile and build successfully.

Upvotes: 1

Lasse Henrich
Lasse Henrich

Reputation: 1

In my case I just had to go to Edit Scheme > Run and Reselect "None" as Executable.

Upvotes: -1

Roger Perez
Roger Perez

Reputation: 3129

For me i had to change/edit the schema and choose the new one.

I had renamed my debug schema to debug(development) and that was causing my problem.

Fix:

  1. Product > Edit Schema > Change Build Configuration

Edit Schema

What I did was create alternate Configurations and renamed my current one.

enter image description here

Upvotes: 3

Pandurang Yachwad
Pandurang Yachwad

Reputation: 1723

I was facing same issue and I tried multiple things but still it was not working. I tried below.

  1. Using XCworkspace file
  2. Cleaned the project, restarted XCode, Mac
  3. Turned bitcode to No
  4. Deleted the search path for Framework, Library

Finally the thing that worked is, deleting pod file and re-creating pod file. It worked as magic!

P.S.: This is very generic error and so same solution may not work for all.

Upvotes: 5

Mayank Modi
Mayank Modi

Reputation: 73

Go To Project Target > Build Settings:

Look for Search Paths > Framework Search Paths, delete all paths which you have been warned; then in Library Search Paths, delete all paths which you have been warned.

Upvotes: 2

genghiskhan
genghiskhan

Reputation: 1149

Make sure you are opening the workspace file and not the project file. I was receiving the same error and realized I was using the project not the workspace.

Upvotes: 58

Related Questions