Search code examples
iosswiftcocoapodsiot

Why am I getting "No such module 'ESPProvision'" Error in swift even though the pod is installed?


I am attempting to run sample code from Esprissif for their ESPProvision library, it comes with the following podfile:

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

target 'ESPProvisionSample' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ESPProvisionSample
  pod 'ESPProvision'
  pod 'MBProgressHUD'

  target 'ESPProvisionSampleTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'ESPProvisionSampleUITests' do
    # Pods for testing
  end

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'YES'
      config.build_settings['ARCHS'] = 'arm64'
    end
  end
end

This runs successfully when I run pod install and the pods seem to be correctly installed within the pod file structure, however when i try to build the project I get the error:

No such module 'ESPProvision'

I am new to coding in swift, but in my previous project, simply having the pod file installed was enough for the file to be able to be found anywhere within the code of the app. Do I need to explicitly call the library using its relative pwd?

I also attempted clearing the derived data and I attempted re-installing the pods, but it didn't help.

File structure for the relevant files if it helps:

- ESPProvisionSample
  - Provision
    - ConnectViewController.swift // this is where 'import ESPProvision' is called and not found

- Pods
  - Pods
    - ESPProvision

EDIT:

I've also now tried to build the ESPProvision module separately by going to Product -> Scheme -> New Scheme and selecting ESPProvision, it built successfully but when I built the main project it once again gives me the same error as above.

Also for clarity yes I am running the project using the generated .xcworkspace file

It seems maybe the framework is missing from ESPProvisionSample -> Frameworks folder, could it be that?


Solution

  • I'm closing this question, it was an issue with the library itself. I opened a ticket with Espressif and they updated their code https://github.com/espressif/esp-idf-provisioning-ios/issues/57