Search code examples
iosobjective-cswiftxcodecocoapods

Xcode - Include of non-modular header inside framework module error when archiving project


I'm currently trying to archive my project to finally update my app on the app store when I came across this issue.

I'm getting this error on multiple files in the XlsxReaderWriter framework.

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

enter image description here

enter image description here

I had issues with this framework in the past but unfortunately this is the only one of it's kind that writes to excel files. I had to makes some changes in order for it work as shown here.

I tried everything to fixed this such as:

  • setting "Allow Non-modular Includes in Framework Modules" to YES to both the Pods project and LoanMaster
  • Cleaning the project and deleting the derivedData a bunch of times
  • Reinstalling Xcode.
  • placing XMLDictionary.h as a public header as mentioned in one of the stack overflow answers
  • Making sure that the framework is public
  • Updated pods to the latest version (1.8.4)

The strange thing is that I archive this project in the past with this framework with the same exact changes to it. The library hasn't been updated in 3 years so nothing new should had cause this. Is this an issue with the new version of Xcode?

I really just want to update my app that I been working on for the past 6 months :(

Any help will be amazing!


Podfile

# 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

Solution

  • I solved the problem by adding XMLDictionary.h to my public headers for XlsxReaderWriter and changing import "XMLDictionary/XMLDictionary.h" back to "XMLDictionary.h".

    I followed this answer

    I hope this helps someone who's still using this old and forgotten framework.