ld:pod安装后找不到GTMSessionFetcher的框架

时间:2023-01-18 00:07:26

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.

我将Firebase库添加到我的项目中,然后我收到了此错误。当我编译它时,Xcode找不到一些目录。但是,它们位于Pods目录中。

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:

这是我的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

3 个解决方案

#1


37  

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.

确保打开工作区文件而不是项目文件。我收到了同样的错误,并意识到我使用的是项目,而不是工作空间。

#2


2  

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

我遇到了同样的问题,我尝试了多种方法,但仍然无法正常工作。我在下面试过。

  1. Using XCworkspace file
  2. 使用XCworkspace文件
  3. Cleaned the project, restarted XCode, Mac
  4. 清理了项目,重新启动了XCode,Mac
  5. Turned bitcode to No
  6. 将bitcode改为No
  7. Deleted the search path for Framework, Library
  8. 删除了Framework,Library的搜索路径

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

最后有用的是删除pod文件并重新创建pod文件。它起到了魔力的作用!

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

P.S。:这是非常一般的错误,所以同样的解决方案可能不适用于所有人。

#3


1  

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.

查找“搜索路径”>“框架搜索路径”,删除已被警告的所有路径;然后在“库搜索路径”中,删除已被警告的所有路径。

#1


37  

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.

确保打开工作区文件而不是项目文件。我收到了同样的错误,并意识到我使用的是项目,而不是工作空间。

#2


2  

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

我遇到了同样的问题,我尝试了多种方法,但仍然无法正常工作。我在下面试过。

  1. Using XCworkspace file
  2. 使用XCworkspace文件
  3. Cleaned the project, restarted XCode, Mac
  4. 清理了项目,重新启动了XCode,Mac
  5. Turned bitcode to No
  6. 将bitcode改为No
  7. Deleted the search path for Framework, Library
  8. 删除了Framework,Library的搜索路径

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

最后有用的是删除pod文件并重新创建pod文件。它起到了魔力的作用!

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

P.S。:这是非常一般的错误,所以同样的解决方案可能不适用于所有人。

#3


1  

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.

查找“搜索路径”>“框架搜索路径”,删除已被警告的所有路径;然后在“库搜索路径”中,删除已被警告的所有路径。