How to fix `"Couldn't IRGen expression"`

  • 5 January 2022
  • 0 replies

Userlevel 5
Badge +8
  • RevenueCat Staff
  • 236 replies

After installing the framework by using Carthage with XCFrameworks, some developers have run into an issue when debugging. The issue is that when using `po` to print objects, an error saying `Couldn’t IRGen expression` gets returned.


The underlying issue has to do with the way that LLDB stores and looks up debug symbols, which get tied to the machine that originally built the framework. 


More information on the issue can be found in the following articles: 

Thankfully, this can easily be worked around:

  • One solution is to pass --no-use-binaries to Carthage (making the overall command carthage update purchases-ios --use-xcframeworks --no-use-binaries, so that the machine that builds the framework is the same one that’s used to debug, thus solving the issue. However, this might not be useful to everyone, since building the framework locally can be very slow. 
  • Another solution is to add a single, empty Objective-C .m file to the project, and add a bridging header. 


0 replies

Be the first to reply!