Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 14.3 "no such module '__ObjC'"

Xcode Screenshot:

enter image description here

Project Details:

  • The project is an Objective-C project originally created in 2012.

  • Roughly 33% of the code base is now in Swift.

  • Project has Cocoapod dependencies.

  • Project compiles with no issues on Xcode 14.2

Xcode 14.3 Issue:

  • On Xcode 14.3 project does not build and the errors thrown are in Xcode generated files ProjectName.private.swiftinterface and ProjectName.swiftinterface

  • Xcode says 'no such module __ObjC'

    • failed to verify module interface 'ProjectName' due to errors above; the textual interface may be broken by project issues or a compiler bug
  • See attached screenshot for full a visual.

What we've tried:

  • pod install --repo-update

  • full project clean, delete Derived Data folder, clean again, try to build again.

Question:

  • Does the community think this is an Xcode issue? Or is there something wrong in our Build Settings/Info.plist file? Has anyone encountered this before?

Any help would be highly appreciated!

like image 907
franke1615 Avatar asked Mar 01 '26 00:03

franke1615


2 Answers

Posting as answer per a commenter suggestion:

In the case of this project what solved the issue was setting the "Build Libraries for Distribution" flag to "No". The errors went away, and the project now compiles in Xcode 14.3.

like image 192
franke1615 Avatar answered Mar 02 '26 12:03

franke1615


Linking as static frameworks by adding use_frameworks! :linkage => :static to your Podfile. Flipper does not work when use_frameworks is enabled, and you should remove it from Podfile.

Adding the -no-verify-emitted-module-interface flag to failing targets to avoid verification failure. You can add the following post install hook to your Podfile to automatically add this flag. In my case my Pods were AEP so I used "AEP".

post_install do |installer|
  installer.pods_project.targets.each do |t|
    if t.name.start_with?("AEP")
      t.build_configurations.each do |bc|
          bc.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -no-verify-emitted-module-interface'
      end
    end
  end
end

https://github.com/adobe/aepsdk-rulesengine-ios/issues/68#issuecomment-1548199715

like image 20
candyline Avatar answered Mar 02 '26 12:03

candyline



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!