gpt4 book ai didi

ios - 将 CocoaPods 与 2 个项目一起使用时的运行时输出 objc[69590]

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:58:10 26 4
gpt4 key购买 nike

我创建了 2 个 xcode 项目“mylib”和“myapp”

  • mylib 的项目类型是“iOS -> Cocoa Touch Framework
  • myapp 的项目类型是“iOS -> Application -> Single View Application”。

这两个项目都依赖于“AFNetworking”,所以我在下面编写了 Podfile。

workspace 'myapp'

platform :ios,'7.0'
xcodeproj 'myapp/myapp.xcodeproj'

target :myapp do
xcodeproj 'myapp/myapp.xcodeproj'
pod 'AFNetworking', '~> 2.5.4'
end

target :mylib do
xcodeproj 'mylib/mylib.xcodeproj'
pod 'AFNetworking', '~> 2.5.4'
end

运行“pod install”后,我得到了https://github.com/everettjf/cocoapods_two_projects_obj69272 , 并且构建没有错误。

但是当我在“iOS模拟器”中运行时,控制台窗口中输出了很多警告消息。

objc[69590]: Class AFHTTPRequestOperation is implemented in both /Users/everettjf/Library/Developer/Xcode/DerivedData/myapp-exzydcmjfladtpgxcrxfchlkcmux/Build/Products/Debug-iphonesimulator/mylib.framework/mylib and /Users/everettjf/Library/Developer/CoreSimulator/Devices/409F22C7-031F-495C-BE66-EE4712D0D469/data/Containers/Bundle/Application/A94992B7-C057-4842-9B64-D8B8E2E5E4DE/myapp.app/myapp. One of the two will be used. Which one is undefined.
objc[69590]: Class AFHTTPRequestOperationManager is implemented in both /Users/everettjf/Library/Developer/Xcode/DerivedData/myapp-exzydcmjfladtpgxcrxfchlkcmux/Build/Products/Debug-iphonesimulator/mylib.framework/mylib and /Users/everettjf/Library/Developer/CoreSimulator/Devices/409F22C7-031F-495C-BE66-EE4712D0D469/data/Containers/Bundle/Application/A94992B7-C057-4842-9B64-D8B8E2E5E4DE/myapp.app/myapp. One of the two will be used. Which one is undefined.
objc[69590]: Class AFHTTPSessionManager is implemented in both /Users/everettjf/Library/Developer/Xcode/DerivedData/myapp-exzydcmjfladtpgxcrxfchlkcmux/Build/Products/Debug-iphonesimulator/mylib.framework/mylib and /Users/everettjf/Library/Developer/CoreSimulator/Devices/409F22C7-031F-495C-BE66-EE4712D0D469/data/Containers/Bundle/Application/A94992B7-C057-4842-9B64-D8B8E2E5E4DE/myapp.app/myapp. One of the two will be used. Which one is undefined.
objc[69590]: Class AFNetworkActivityIndicatorManager is implemented in both /Users/everettjf/Library/Developer/Xcode/DerivedData/myapp-exzydcmjfladtpgxcrxfchlkcmux/Build/Products/Debug-iphonesimulator/mylib.framework/mylib and /Users/everettjf/Library/Developer/CoreSimulator/Devices/409F22C7-031F-495C-BE66-EE4712D0D469/data/Containers/Bundle/Application/A94992B7-C057-4842-9B64-D8B8E2E5E4DE/myapp.app/myapp. One of the two will be used. Which one is undefined.
...(more)

我该如何解决?谢谢。

最佳答案

最后,我找到了 2 个解决方案。

  1. 解决方案 1

    mylib -> TARGETS(mylib) -> build设置 -> 链接 -> Mach-O 类型:静态库

  2. 解决方案 2

    只需添加“use_frameworks!”到 Podfile

更多信息,请查看here

关于ios - 将 CocoaPods 与 2 个项目一起使用时的运行时输出 objc[69590],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32109812/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com