Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading from Nimble 9.2.1 to Nimble 11.2.1 (Latest) could not be built as it could not build module header nimble #1030

Open
1 task done
caolaningenie opened this issue Feb 6, 2023 · 0 comments

Comments

@caolaningenie
Copy link

  • I have read CONTRIBUTING and have done my best to follow them.

What did you do?

Upgraded Pod to install 11.2.1, it had been 9.2.1.

What did you expect to happen?

I expected the tests to run successfully.

What actually happened instead?

I am getting two errors that I have been unable to workout as to why they are happening:

  1. Build/Products/Debug-iphonesimulator/Nimble/Nimble.framework/Headers/Nimble-Swift.h:797:9: error build: Include of non-modular header inside framework module 'Nimble.Swift': '/Users/caolanowens/Developer/iOS-Feedback-AaaS/Pods/Nimble/Sources/Nimble/Nimble.h'.
  2. error build: Could not build Objective-C module 'Nimble'.

Environment

List the software versions you're using:

  • Quick: 6.1.0
  • Nimble: 11.2.1
  • Xcode Version: 14.0.1 (Open Xcode; In menubar: Xcode > About Xcode)
  • Swift Version: 5.7 (Open Xcode Preferences; Components > Toolchains. If none, use Xcode Default.)

Please also mention which package manager you used and its version. Delete the
other package managers in this list:

  • Cocoapods: 1.11.3

Project that demonstrates the issue

I am unable to provide the project as it is company project. Whenever I do create a clean project I do not have any issues. It is a possibliity that there is an issue with our build settings but after much research and changes I am left with the same result. I have added our Podfile below, hopefully this can help.

#source 'https://github.com/CocoaPods/Specs.git'
#source 'https://cocoapods-cdn.netlify.app/'
#source 'https://cdn.cocoapods.org/'

platform :ios, '14.0'

project 'Project.xcodeproj'

inhibit_all_warnings!

def use_pods
  pod 'SwiftLint'
  pod 'Alamofire'
  pod 'SwiftyJSON'
  pod 'Alamofire-SwiftyJSON'
  pod 'PureLayout'
  pod 'RxSwift'
  pod 'RxCocoa'
  pod 'RxDataSources'
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'
  pod 'RealmSwift'
  pod 'RxRealm'
  pod 'Action'
  pod 'Firebase/Core', '< 10.0'
  pod 'Firebase/Analytics', '< 10.0'
  pod 'Firebase/Crashlytics', '< 10.0'
  pod 'OneSignalXCFramework', '>= 3.0.0', '< 4.0'
  pod 'ReachabilitySwift'
  pod 'Backgroundable'
  pod 'KeychainSwift'
  pod 'DeviceKit'
  pod 'LiveChat'
  pod 'CSV.swift'
  pod 'Mixpanel-swift'
end

def test_pods
  pod 'Quick', '6.1.0'
  #pod 'Nimble', '< 8.0'
  pod 'Nimble', '11.2.1'
  pod 'RxTest'
  pod 'RxBlocking'
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'
  pod 'RealmSwift'
  pod 'RxSwift'
  pod 'RxCocoa'
  pod 'KeychainSwift'
  pod 'OHHTTPStubs/Swift'
  pod 'Mixpanel-swift'
end

target 'Project' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  use_pods
  pod 'LocalCompanyPod', :path => '../LocalCompanyPod/',  :inhibit_warnings => false
  
end

target 'Project-Tests' do
  use_frameworks!
  test_pods
  pod 'LocalCompanyPod', :path => '../LocalCompanyPod/',  :inhibit_warnings => false
end

target 'ProjectUITests' do
  use_frameworks!
  test_pods
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
      
          target.build_configurations.each do |config|
            # Xcode 12 fix for iOS 8 warning
            config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
            
            # this build setting must not be applied to Quick and Nimble
            # as it breaks them
            if (!['Quick'].include? target.name) && (!['Nimble'].include? target.name)
            # trying to stop app extensions breaking build cos clash with pods
            config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
            end
            
           if config.name == 'Test'
                config.build_settings['ENABLE_TESTABILITY'] = 'YES'
           end

            if ['PromiseKit'].include? target.name
              config.build_settings['SWIFT_VERSION'] = '4.0'
            end
            
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
            config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
            
          end
  end
  installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
    configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
  end
end

Additional

I have went through the commit history of Nimble and locally cloned the project to run through the commit history where possible, however, came up short. I did notice one thing that could be suspicious and a reason for this issue:

Specify header_dir in the podspec: 296d283.

When I remove this line it didn't have any intended affect on the fix but I thought it was worth mentioning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant