Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate entries in Xcode Resources for localisation files #14

Closed
Menardi opened this issue Sep 5, 2017 · 7 comments
Closed

Duplicate entries in Xcode Resources for localisation files #14

Menardi opened this issue Sep 5, 2017 · 7 comments

Comments

@Menardi
Copy link

Menardi commented Sep 5, 2017

When building for iOS, as well as copying translations to the correct folder, they need to be added as Resources in the Xcode project. The plugin does this correctly, but it seems to be adding them to Resources each time -- it should only do this the first time. The result is duplicate entries in Resources, which causes builds to fail with an error like:

error: failed to remove /Users/x/Library/Developer/Xcode/DerivedData/app_id/Build/Products/Debug-iphoneos/AppName.appex/de.lproj/Localizable.strings: “Localizable.strings” couldn’t be removed.

Below is a screenshot showing the duplicates in Xcode. In this case there are two sets, but I have seen up to four.
screen shot 2017-09-05 at 18 26 09

I guess the fix here is to check if the file exists in Resources already before adding it. Is that possible with the current set up?

@kelvinhokk
Copy link
Owner

Hi Menardi, did you do multiple cordova prepare?

For now, you might have to cordova clean before you build. My build script typically drops

  1. cordova platform remove {platform}
  2. cordova platform add {platform}
  3. cordova build {platform}.

@chriswep
Copy link

chriswep commented Oct 9, 2017

I also ran into this (i think). However for me the Cordova build crashes if i don't remove InfoPlists.strings from the Xcode Project before. Removing the platform before every build is no option for me.

As a workaround i delete the files via my build script before building now, which does the job.

@Menardi
Copy link
Author

Menardi commented Nov 21, 2017

Apologies for the delay in replying here! I typically do a cordova build ios when I've made JS changes so they get copied over to the platforms folder. Removing and re-adding the platform is no good for me, as I have to make quite a few manual changes to the Xcode project for my build.

As a workaround at the moment, I uninstall the plugin after the first build. As a I don't typically make changes to my translations files, this is doable.

@kelvinhokk
Copy link
Owner

I am encountering this issue with the latest Cordova 7.1.0 and cordova-iOS 4.5.3, even after removing platform and adding platform again.

Will be updating this plugin soon.

@cvaliere
Copy link

cvaliere commented Dec 6, 2017

@kelvinhokk do you plan to solve the issue this week?

if not, we'll look into it, as we need it to be solved

thanks!

@kelvinhokk
Copy link
Owner

I've tested and committed a fix which I believe should solve this issue.

@cvaliere
Copy link

cvaliere commented Dec 7, 2017

thank you, it seems to work!

AbhishekJoshi pushed a commit to AbhishekJoshi/cordova-plugin-localization-strings that referenced this issue Feb 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants