0
votes

I localized all my xib files with base Internationalization and localizable Strings for each language. My Folder structure for the localized xibs is e.g. like this

base.lproj/LoginView.xib
de.lproj/LoginView.strings
en.lproj/LoginView.strings

On the simulator everything is working!! On the device I get the error

Could not load NIB in bundle: 'NSBundle </var/mobile/Containers/Bundle/Application/FCAF9E1E-7871-4DC4-8B2B-0B83F94585F0/myApp.app> (loaded)' with name 'LoginView''

With the following command I checked which resources are available on each device:

print(NSBundle.mainBundle().pathsForResourcesOfType("nib", inDirectory: nil))

And here I see that all base-xibs are available in the base.lproj folder on the simulator, but NOT on the real device. These files are just missing on the real device.

What works: On the real device xibs(!) in e.g. en.lproj or de.lproj get copied, when I change from localizable strings to xib for each localized file.

I already did a clean, cleaned the Build folder, derived data folder and deleted of course the app from the phone. I also restarted everything (as many people suggest). Nothing worked.

What could stop Xcode from copying the files in the base.lproj folder to the real device? (As xibs in en.lproj and de.lproj are copied over)

1

1 Answers

1
votes

I ended up with a solution that I didn't find anywhere. So in case it may help someone:

  1. I removed all localized xib files from the "Copy Bundle Resources" build phase
  2. I removed all localized xib files from the project
  3. I copied all xib files from the base.lproj folder back to the parent folder
  4. I removed all localization folders with content (en.lproj, ...)
  5. I added the files one by one to the project and localized them again