Swift frameworks do not work with build configurations named other than 'Debug' or 'Release': No such module

前端 未结 4 456
感动是毒
感动是毒 2020-12-23 09:08

Whenever I try to use a build configuration named other than \'Debug\' or \'Release\', Xcode suddenly cannot find my Swift frameworks. The configurations are the exact same

相关标签:
4条回答
  • 2020-12-23 09:33

    If you have a modular structure (e.g. the App uses frameworks to decouple UI, Services or Business Logic from the application's main module) then add the new Build Configuration to each subproject that builds these frameworks.

    In this case if the author had, let's say, Services Framework in his workspace then he had to add a Debug Original configuration to it too. And then run pod install, of course.

    This is how I fixed my issue.

    0 讨论(0)
  • 2020-12-23 09:36

    Add the following Framework Search Path in the Build Settings of your target: $(SYMROOT)/Release$(EFFECTIVE_PLATFORM_NAME) and make it non-recursive

    In my case this was for Alamofire, which was added to my project as a git submodule.

    The framework was being built correctly which can be seen in the build logs, but I assume the default framework search path is derived from the scheme name. The Alamofire framework & dSYM file are in Release-iphoneos/ Release-iphonesimulator.

    This should work work with any Swift framework as long as it's scheme names are default. If not, check the build logs and adjust the framework search path accordingly.

    0 讨论(0)
  • 2020-12-23 09:37

    I had this issue as well and fixed it by adding the same configuration names to the included Alamofire project.

    My build schemes in my main project:

    And the build schemes inside the Alamofire project:

    Note: Also, make sure your iOS deployment target is the same in both projects.

    0 讨论(0)
  • 2020-12-23 09:42

    If you are using CocoaPods, try pod install this will generate some .xcconfig files with your configuration name. Clean your build folder and build again.

    0 讨论(0)
提交回复
热议问题