【问题标题】:How to solve "ld: framework not found Alamofire" in swift 3如何在 swift 3 中解决“ld: framework not found Alamofire”
【发布时间】:2018-03-15 11:36:28
【问题描述】:

我的项目运行良好,但是当我添加了 alamofire 时它无法正常工作。

出现以下错误

ld:警告:找不到选项的目录 '-F/Users/banglafire/Desktop/mysios/Build/Products/Debug-iphonesimulator/Alamofire' ld:找不到框架 Alamofire clang:错误:链接器命令失败 退出代码为 1(使用 -v 查看调用)

其他信息

Cocopad 1.3.1 版

我的 pod 文件

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

target 'My' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for My
  pod 'Alamofire'

end

我该如何解决?请帮忙!

【问题讨论】:

标签: ios swift cocoapods


【解决方案1】:

我遇到了同样的问题。所以我认为你打开.xcodeproj.你需要打开.xcworkspace

【讨论】:

    【解决方案2】:

    我认为你的 Pod 文件有一些问题应该如下:

    # Uncomment the next line to define a global platform for your project
    
    platform :ios, '9.0'
    
    target 'My' do
     # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
     use_frameworks!
    
    pod 'Alamofire', '~> 4.4'
    
       target 'MyTests' do
    
       inherit! :search_paths
       # Pods for testing
       end
    
       target 'MyUITests' do
    
       inherit! :search_paths
       # Pods for testing
       end
    
    end
    

    尝试删除 Pod 文件并再次安装 pod 文件并添加类似这样的 pod。希望这可以帮助你。

    【讨论】:

      【解决方案3】:

      尝试添加alamofire的版本

      pod 'Alamofire', '~> 4.5'

      然后运行 ​​pod install

      【讨论】:

      【解决方案4】:

      您是否已经更新了项目文件夹中的 pod?

      还要检查你的 pod 是否正确。

      https://github.com/Alamofire/Alamofire

      当您在项目中添加一些 pod 时,您仍然需要更新您的文件夹。

      尝试使用终端->然后转到您的文件夹项目->输入pod install

      【讨论】:

      • 您是否尝试过查看您的构建设置?转到您的目标 -> 构建设置 -> 然后搜索 Search Paths 您将看到框架搜索路径,您的 pod 是否已经包含在其中。示例:$(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire
      • 没有。没有 PODS_CONFIGURATION_BUILD_DIR。如何设置。请指导我。
      【解决方案5】:

      我最近也遇到了这个问题。 我在这里尝试了很多建议的修复方法,但没有一个真正解决了问题。

      实际问题是在应用的构建设置中设置的值不正确。

      将 Per-configuration Build Products Path 设置为:

      CONFIGURATION_BUILD_DIR = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)

      问题已解决,我的构建成功。

      【讨论】:

        猜你喜欢
        • 2022-06-14
        • 2016-12-10
        • 1970-01-01
        • 1970-01-01
        • 2018-04-03
        • 2016-05-23
        • 2015-09-04
        • 2018-05-30
        • 2018-10-10
        相关资源
        最近更新 更多