2

After updating to Xcode 11.5, I cannot import My Universal framework. Basically, I have created one framework and also generated the universal framework. The framework was compiled in the lower version of Swift (Swift 5.1). It worked fine previously. While importing the same framework in the same project in XCode 11.5 (Swift 5.2), it throws the following error.

Module compiled with Swift 5.1.2 cannot be imported by the Swift 5.2.4 compiler I have already marked the Build Libraries for Distribution to Yes and Skip Install to No.

Please help. Thank you in advance!

  • So, what you are trying to do is an XCFramework that is build with Swift 5.1 compiler and can be imported to a Swift 5.2 project? Compiling the XCFramework with Swift 5.2 compiler is not an option? – gcharita Aug 14 '20 at 09:55
  • If you are trying to make a simple Framework, maybe the comments of this answer can help https://stackoverflow.com/a/58656323/6791677 – gcharita Aug 14 '20 at 10:05
  • 1
    @gcharita, Thank you for the reference link. I have done the BUILD_LIBRARY_FOR_DISTRIBUTION = YES; in my universal framework. But it is not working. I have compiled it in swift 5.2 but not able to use in swift 5.1. Please note, I'm not creating XCFramework. I'm creating framework only. – Debashish Dash Aug 15 '20 at 10:06
  • Interesting. I tried the same exact thing and seems to work correctly. I used Xcode 11.2.1 for exporting my framework. (imported in an Xcode 11.6 project) What Xcode version are you using to export your framework? – gcharita Aug 15 '20 at 12:36
  • @gcharita, I'm using XCode 11.5 for exporting my framework. I'll be grateful to you if you are sharing a sample with me (Both Framework & Sample Project). It also helps me to match with my code. – Debashish Dash Aug 15 '20 at 16:46
  • Oh now I see! You are trying to import a Swift 5.1 framework to a Swift 5.2 framework project. You are having 2 frameworks, one universal and one which is more specific. Is this correct? – gcharita Aug 15 '20 at 19:17
  • Yes. there are two frameworks. one universal and one which is more specific – Debashish Dash Aug 16 '20 at 10:41
  • Up until now I was trying to import the first framework into an iOS project, that's why I wasn't getting any error. With exactly the same scenario as yours I am getting a different kind of error (Failed to import module) Did you faced anything like that? – gcharita Aug 16 '20 at 17:03

0 Answers0