Exporting localization using xcodebuild with a project containing macros

I've a workspace with multiple packages, and due to the a bug in Xcode I cannot export the app localizations using the Xcode GUI tool, but I need to resort on using a command from terminal

xcodebuild -exportLocalizations -localizationPath . -workspace <path_workspace> -sdk iphoneos -exportLanguage en

One of my packages contains some macros, and I use them from my code without any problem, the code compile

But when I try to export localizations using that command, the build fails due to "compiler plugin not loaded"

So I cannot use Xcode normal exporting because Xcode bug, and cannot export by running a command due to the macro problem

What should I do? It is very discouraging this situation, do you have any suggestion?

I've found a similar problem

Hello,

Instead of running xcodebuild -exportLocalizations with -sdk iphoneos, try using -destination 'platform=iOS,name=Any iOS Device'. This should work better where macros are involved.

Hi, I've tried your method, but it appears that while exporting localization using that destination (and removing -sdk), it is trying to build also for macOS.

If I leave -sdk while adding -destination it starts to compile only for iOS, but the "cannot find external macro" error returns.

Maybe the root cause is the same that prevents me to use Xcode itself (not xcodebuild) for exporting localization. While exporting localization from Xcode, if I'm using a package Xcode will try to export the localization both using iOS and macOS sdk (with destination null)

Maybe when using the destination flag (instead of the sdk) the localization export tries to compile for both iOS and macOS (Which of course cannot compile due to the fact I'm using iOS only apis)

Exporting localization using xcodebuild with a project containing macros
 
 
Q