【问题标题】:Xcode - Include of non-modular header inside framework module error when archiving projectXcode - 归档项目时在框架模块中包含非模块化标头错误
【发布时间】:2020-04-06 08:11:33
【问题描述】:

当我遇到此问题时,我目前正在尝试归档我的项目,以便最终在应用商店中更新我的应用。

XlsxReaderWriter 框架中的多个文件出现此错误。

Include of non-modular header inside framework module 'XlsxReaderWriter.BRARelationship': '/Users/dannyespina/Documents/iOS_Applications/LoanMaster/loan-master/Pods/XMLDictionary/XMLDictionary/XMLDictionary.h'

我过去曾遇到过这个框架的问题,但不幸的是,这是唯一一个写入 excel 文件的框架。我必须进行一些更改才能使其工作,如 here 所示。

我尝试了一切来解决这个问题,例如:

  • 将 Pods 项目和 LoanMaster 的“允许框架模块中的非模块化包含”设置为“是”
  • 清理项目并多次删除derivedData
  • 重新安装 Xcode。
  • 将 XMLDictionary.h 作为堆栈溢出答案之一中提到的公共标头
  • 确保框架是公开的
  • 已将 pod 更新到最新版本 (1.8.4)

奇怪的是,我过去使用这个框架存档了这个项目,并对其进行了完全相同的更改。图书馆已经 3 年没有更新了,所以没有什么新东西会导致这个。这是新版本 Xcode 的问题吗?

我真的只是想更新我过去 6 个月一直在开发的应用程序 :(

任何帮助都会很棒!


播客文件

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

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

  # Pods for LoanMaster
  pod 'MPNumericTextField', '~> 1.4.0'
  pod 'Charts', '~> 3.2.1'
  pod 'LGButton'
  pod 'RealmSwift'
  pod 'SpreadsheetView'
  pod 'IQKeyboardManagerSwift'
  pod 'GoogleMobileAdsMediationMoPub'
  pod 'PersonalizedAdConsent'
  pod 'PopupDialog', '~> 1.1'
  pod 'NVActivityIndicatorView'
  pod 'FBAudienceNetwork'
  pod 'Firebase/Core'
  pod 'Firebase/AdMob'
  pod 'XlsxReaderWriter', '~> 1.0'
  pod 'M13Checkbox'

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        if ['SpreadsheetView', 'IQKeyboardManagerSwift', 'NVActivityIndicatorView'].include? target.name
          target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.0'
          end
        target.build_configurations.each do |config|
          config.build_settings['CLANG_WARN_DOCUMENTATION_COMMENTS'] = 'NO'
        end
      end
    end
  end

end

【问题讨论】:

  • 您是否尝试过让项目文件脱离 Pod 的控制,并直接将框架添加到您的项目中?
  • 我会尝试从 cocoapods 中删除 XlsxReaderWriter 并将其放入我的项目中,看看是否可行

标签: ios objective-c swift xcode cocoapods


【解决方案1】:

我通过将 XMLDictionary.h 添加到 XlsxReaderWriter 的公共标头并将导入“XMLDictionary/XMLDictionary.h”更改回“XMLDictionary.h”解决了这个问题。

我关注了这个answer

我希望这对仍在使用这个古老而被遗忘的框架的人有所帮助。

【讨论】:

    【解决方案2】:

    尝试从 podfile 中删除 XMLDictionary 的 pod 并再次添加它会起作用。

    【讨论】:

    • 我的 podfile 不包含 XMLDictionary。这源自 XlsxReaderWriter 框架本身。我用我的 podfile 更新了我的帖子
    猜你喜欢
    • 2016-11-20
    • 2018-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-23
    • 2017-07-08
    • 2016-02-08
    相关资源
    最近更新 更多