我们如何在cocoapod框架中使用DJIWidget

问题描述 投票:1回答:2

我正在努力将DJIWidget纳入我们的cocoapod dev环境。

我们有一个带有DJI源码的cocoapod框架,我们希望将DJIWidget作为依赖来使用DJIVideoPreviewer,但我尝试的每一种方式都无法让它工作,主要问题是FFmpeg静态二进制。

使用旧的VideoPreviewer,我们不得不从项目中创建一个胖库,但旧的视频监视器不包含FFmpeg二进制文件。然后,构建的框架可以与vendored_frameworks一起使用,通过cocoapods加载它。

如果我像以前一样使用DJIWidget创建Fat Library,在pod安装上,我们会收到以下错误:

[!] The 'xxx-pod target has transitive dependencies that include static binaries

我采取的另一种方法是尝试从项目中构建cocoapod,如下所示:

  s.source_files          = "DJIWidget/**/*.{h,m}"
  s.public_header_files   = "DJIWidget/**/*.h"

  s.pod_target_xcconfig   = { 'ENABLE_BITCODE' => 'NO' }

  s.vendored_frameworks  = "FFmpeg/FFmpeg.framework"

但是当我尝试安装pod时,找不到FFmpeg头文件,将FFmpeg头文件添加到public_header_files会导致另一个错误。

记录在https://developer.dji.com/mobile-sdk/documentation/ios-tutorials/index.html中添加代码的方法对我们不起作用

ios cocoapods dji-sdk
2个回答
2
投票

DJI现在通过cocoapods提供DJIWidget,https://github.com/dji-sdk/DJIWidget所以这个问题已不再适用!

编辑:为了完整性,这是他们配置podspec的方式,使用xconfig指定标头:

#
#  Be sure to run `pod spec lint DJI-SDK-iOS.podspec' to ensure this is a
#  valid spec and to remove all comments including this before submitting the spec.
#
#  To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
#  To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#

Pod::Spec.new do |s|

  s.name         = "DJIWidget"
  s.version      = "1.0"
  s.summary      = "DJIWidget for DJI iOS Mobile SDK"
  s.homepage     = "https://github.com/dji-sdk/DJIWidget"
  s.license      = { :type => 'CUSTOM', :text => <<-LICENSE
****************************************************************************************************************************
DJIWidget is offered under MIT License (See below).
The MIT License (MIT)
Copyright (c) 2018 DJI
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
****************************************************************************************************************************
    LICENSE
  }

  s.author       = { "DJI SDK" => "[email protected]" }
  s.source       = { :git => 'https://github.com/dji-sdk/DJIWidget.git', :tag => s.version.to_s, :submodules => true }
  s.requires_arc = true
  s.platform     = :ios, '8.0'
  s.source_files = 'DJIWidget/**/*.{h,m,c}'
  s.ios.public_header_files = 'DJIWidget/**/*.{h}'
  s.ios.vendored_frameworks = 'FFmpeg/FFmpeg.framework'
  s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Public/DJIWidget/FFmpeg/.."/**' }
  s.pod_target_xcconfig = {'ENABLE_BITCODE' => 'NO'}

end

0
投票

请将DJIWidget版本更新为1.1。 https://github.com/dji-sdk/DJIWidget

© www.soinside.com 2019 - 2024. All rights reserved.