(SOLVED) Application crash with NotSupportedException

Hello. Our game works well in Unity Editor and Android, but when we build for IOS we can see this error in Xcode:
Unhandled Exception: System.NotSupportedException: CodePage 1251 not supported at System.Text.GetEncoding()
After that application quit. We are using the latest version of Unity and Xcode. Scripting Backend is IL2CPP. Can you help me?

@grifdrey

You will probably need to copy the I18N.dll and I18N.West.dll files into your project directory manually so that they are available to the player. This answer has a good discussion about how to do this: http://answers.unity3d.com/questions/42955/codepage-1252-not-supported-works-in-editor-but-no.html

Thank you for the reply. But i’ve already have this files in my project\Assets\Plugins folder. And application still crashing after Encoding.GetEncoding(1251).GetBytes(“Some text”). This problem exist only in IOS version. In dll’s settings value “Any platform” is checked. Maybe we need some special Compile flags for them?

1 Like

@grifdrey

Make sure they are not being stripped before the build happens. You can use a link.xml to force the managed code stripper to preserve them. There are details here:

http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html

Error exists with any value of Strip Engine Code from Unity build settings**.** And link.xml in Assets folder with



didnt help. I18N.dll and I18N.West.dll are in Assets\Plugins folder.

@grifdrey

I think you want to change the link.xml to be

So that it will preserve the localization assemblies. There might be some other problem, but I don’t think that preserving System.dll (as you mentioned earlier) will impact this issue one way or another.

Thank you, i’ll try this.

Solved! link.xml with your data works. Thank you

Excellent! I’m glad to hear that it works.

I have the same pb but for HTML5 target, and your proposition does not resolve my issue :frowning:

EDIT : In fact, it works ! I had a mistake on the filename. It’s “link.xml” and NOT “linker.xml”

Thanks a lot ! :slight_smile:

Hey guys, followed the steps for this and I’m still getting the error on my Crashlytics, should I be seeing the dlls in XCode? Because I can’t, I’ve added all the possible I18N varients aswell and added them to the link.xml respectively

1 Like

The same here.
Copying only that 2 files (I18N & I18N.West) didn’t help me. I had to copy all 6 files.