You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey folks,
we are using R.swift in our codebase to access all localized strings. Now we are trying to export our localizations via the xcodebuild -exportLocalizations command.
Unfortunately it cannot build the project, since it always fails with a cannot find 'R' in scope error for each usage of R.string.<...>. However, the error only occurs if we are using the xcodebuild -exportLocalizations command directly. If we use the UI option via Product -> Export Localizations, the export works just fine.
It seems like the RswiftGenerateInternalResources build tool plugin isn't executed if I use xcodebuild -exportLocalizations and the previously (during a normal build) generated R.generated.swift file is not used.
After I have revisited the build logs of an export through the UI option, I found an easy workaround:
Just disable automatic string extraction by setting SWIFT_EMIT_LOC_STRINGS=NO in the build settings (or pass it directly when invoking xocdebuild -exportLocalizations ...).
Hey folks,
we are using R.swift in our codebase to access all localized strings. Now we are trying to export our localizations via the
xcodebuild -exportLocalizations
command.Unfortunately it cannot build the project, since it always fails with a
cannot find 'R' in scope
error for each usage ofR.string.<...>
. However, the error only occurs if we are using thexcodebuild -exportLocalizations
command directly. If we use the UI option via Product -> Export Localizations, the export works just fine.I have created a demo project replicating the issue: https://github.com/finebel/LanguageSample
It seems like the
RswiftGenerateInternalResources
build tool plugin isn't executed if I usexcodebuild -exportLocalizations
and the previously (during a normal build) generatedR.generated.swift
file is not used.Has anyone experienced something similar or has an idea what the problem might be? Any help is appreciated!
The text was updated successfully, but these errors were encountered: