Skip to main content

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


Andy
RevenueCat Staff
Forum|alt.badge.img+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!

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings