2

I’m trying to change the product module name of a dynamic framework. The main reason I’m doing this is that my framework is customised for each client, so I have different targets with different names and output files that I want to keep different as they are, but I would like the framework to be imported for all the targets with the product name. The framework is in objective C and consumed by a swift application.

In the Xcode build settings the DefinesModule is set to YES.

Let’s say the product name is CustomerSDK and I want it to be imported as ProductSDK. For example: The framework file will be CustomerSDK.framework and the import statement import ProductSDK.

If I use the $(PRODUCT_NAME:c99extidentifier) as the module name (the default option in Xcode) by calling import CustomerSDK it works, but when I try to change the Product Module Name field in build settings to another one the code completion of Xcode in the host application project doesn’t find the module name and even if I write it I get the “No such module ProductSDK” error. Looking inside the resulting product framework I can see that no modulemap file is generated.

I tried also to create a custom module.modulemap file, in this case the code completion of Xcode in the host application project proposes the new name, but when I try to compile I still get the “No such module ProductSDK” error.

framework module ProductSDK {
  umbrella header "CustomerSDK.h"

  export *
  module * { export * }
}
Andrea
  • 24,774
  • 10
  • 79
  • 121
  • Ever able to fix this? Running into the same issue myself. – JoriDor Jan 26 '21 at 09:49
  • 1
    No, it seems that is not possible. also reached Apple tech support and they gave me a workaround that was a viable solution for me. Basically exist a hidden setting in Xcode that make you change the path o the product, here the response `To apply this override, add this setting as a User Defined build setting in Xcode — CONFIGURATION_BUILD_DIR isn’t visible by default.` , but I still had time to try it – Andrea Jan 26 '21 at 18:57
  • Thank you for answering! So what value did you have to give to `CONFIGURATION_BUILD_DIR`? ProductSDK.framework? – JoriDor Jan 27 '21 at 19:46

0 Answers0