11

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!

HangarRash
  • 7,314
  • 5
  • 5
  • 32
franke1615
  • 179
  • 6

3 Answers3

3

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.

franke1615
  • 179
  • 6
  • under what heading in xcode? Where do i find this? – Julia Pak Apr 19 '23 at 02:12
  • 1
    Click on your project file in Xcode, then in the Targets select the Project, then Build Settings tab, and search Build Libraries for Distribution. That sets it globally. You can also do it individually for a Pod in the Pods, Build Settings. – franke1615 Apr 19 '23 at 15:19
  • 1
    This solution doesn't seem to be universal. I need to be able to Archive my project which I can't seem to do with this setting unchecked. I can build it though... – Jordan Bonecutter Apr 24 '23 at 23:09
  • Thanks man!, its been a week, i have been checking the issue. finally it got resolved. but i wonder why the Build Libraries for Distribution effect __objC module? – SoloWolf93 May 29 '23 at 08:26
  • Have you found any solution for Archiving with this error and XC 14.3 ? The solution works for development, this is not a normal behaviour for production build :/ – Akhu Jun 01 '23 at 13:40
  • I don't know if this might help, but if you're using cocoapods an archiving issue we encountered was solved by changing source="$(readlink "${source}")" in the Pods-[ProjectName]-frameworks file to source="$(readlink -f "$source")". Article: https://stackoverflow.com/questions/75574268/missing-file-libarclite-iphoneos-a-xcode-14-3 – franke1615 Jun 02 '23 at 01:12
  • It worked but what about when this app goes to distribution? :) will it matter? – landnbloc Jun 12 '23 at 22:42
1

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

candyline
  • 788
  • 8
  • 17
0

I experience the same. I guess it's an Xcode issue, since it works with the prior version. In the meantime I use @_implementationOnly import to get rid of it.