【问题标题】:Framework not found error after adding my own framework添加我自己的框架后未找到框架错误
【发布时间】:2018-10-28 14:29:01
【问题描述】:

我正在尝试使用本指南学习框架流程:https://www.raywenderlich.com/126365/ios-frameworks-tutorial。创建了一个单独的 cocoa 框架项目,将一些代码移到那里 - 它成功构建,产生 DehancerNavigation.framework 文件。

现在我正在尝试将此框架添加到另一个项目:刚刚为此创建了一个空白项目,并将我的框架添加到 General 选项卡上的嵌入式二进制文件。它也出现在 Linked Frameworks and Libraries 部分。

General tab with added framework

似乎已经足够了,但现在我得到一个构建时错误:

Ld /Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Products/Debug/DehancerNavigationTestUsageProject.app/Contents/MacOS/DehancerNavigationTestUsageProject 正常 x86_64

cd /Users/yefim/Documents/Projects/DehancerNavigationTestUsageProject

导出 MACOSX_DEPLOYMENT_TARGET=10.13

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /MacOSX10.13.sdk -L/Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Products/Debug -F/Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidBuildup /Products/Debug -filelist /Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Intermediates.noindex/DehancerNavigationTestUsageProject.build/Debug/DehancerNavigationTestUsageProject.build/Objects-normal/x86_64/DehancerNavigationTestUsageProject.Link -rpath -Xlinker @executable_path/../Frameworks -mmacosx-version-min=10.13 -Xlinker -object_path_lto -Xlinker /Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProjec t-eqegtcmqsajracgiyxgidupllvbp/Build/Intermediates.noindex/DehancerNavigationTestUsageProject.build/Debug/DehancerNavigationTestUsageProject.build/Objects-normal/x86_64/DehancerNavigationTestUsageProject_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-link-runtime -L/Applications/Xcode。 app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -Xlinker -add_ast_path -Xlinker /Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Intermediates.noindex/DehancerNavigationTestUsageProject。 build/Debug/DehancerNavigationTestUsageProject.build/Objects-normal/x86_64/DehancerNavigationTestUsageProject.swiftmodule -framework DehancerNavigation -Xlinker -dependency_info -Xlinker /Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Intermediates.no .build/Debug/DehancerNavigationTestUsageProject。 build/Objects-normal/x86_64/DehancerNavigationTestUsageProject_dependency_info.dat -o /Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Products/Debug/DehancerNavigationTestUsageProject.app/Contents/MacOS/DehancerNavigationTestUsageProject

ld: 未找到框架 DehancerNavigation

clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)。

我还需要设置什么才能在项目中使用框架吗?

【问题讨论】:

    标签: xcode macos frameworks


    【解决方案1】:

    当我将框架复制到我的项目文件夹而不是对其进行引用时,问题解决了(如果需要复制项目应该设置检查器)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-26
      • 2014-02-20
      • 1970-01-01
      • 2019-11-17
      • 1970-01-01
      • 1970-01-01
      • 2019-07-23
      • 1970-01-01
      相关资源
      最近更新 更多