ios - 在 iOS 中为 Today Extension(Widget) 安装 pods

标签 ios swift widget cocoapods today-extension

如何为在我的应用程序中也命名为 Widget 的扩展程序安装 pod。我已经为我的应用程序目标安装了那个 pod。

我在网上查看过,我发现的解决方案给我带来了屏幕截图中的错误。

enter image description here

以下是我的 pods 文件中的代码:

platform :ios, '9.0'
use_frameworks!

target 'myapp' do
    pod 'Alamofire', '~> 4.8.0'
end

target 'myapp_extension' do
  pod 'Alamofire', '~> 4.8.0'
end



Multiple commands produce '/Users/abc/Library/Developer/Xcode/DerivedData/myapp-hitzznvtnviylfcammkfaxjvlryg/Build/Products/Debug-iphonesimulator/myapp.app/Frameworks/nanopb.framework':
1) That command depends on command in Target 'myapp' (project 'myapp'): script phase “[CP] Embed Pods Frameworks”
2) That command depends on command in Target 'myapp' (project 'myapp'): script phase “[CP] Embed Pods Frameworks”

最佳答案

您可以使用 inherit! :search_paths将相同的 pod 添加到您的扩展程序中

platform: ios, '9.0'

target 'myapp' do
    use_frameworks!
    pod 'Alamofire', '~> 4.8.0'

    target 'myapp_extension' do
        inherit! :search_paths
    end

end

关于ios - 在 iOS 中为 Today Extension(Widget) 安装 pods,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56055939/

相关文章:

在 UiWebView 中使用 webSocket 时 IOS Web 线程停止

ios - 你如何在 Swift 3 中使用 Data.withUnsafeMutableBytes?

qt - 如何正确配置QDockWidget使其显示/隐藏?

javascript - 将天气小部件嵌入到 Google map 的信息窗口中

ios - 提取 NSString 中两个子串之间的部分

ios - 类型 'x' 的值没有成员“小写”

iOS - UITextView 中的新行字符

ios - 如何在 Swift 中锁定单个 UIView 从旋转到横向?

ios - 本地推送通知可以有可变内容吗?

QT:两个布局添加相同的小部件