encoding 1252 data could not be found

Hi,
I'm getting a "1252 encoding not found" error on an Android device in release mode (in debug mode everything is fine).
I'm using Visual Studio 2015.
I think the error occurs when trying to setup a connection to sql server.

Googling for an answer, I found a solution : Android project properties, Android Options, Linker tab, check "West" at additional supported encodings. And it worked! However, then I published a newer version of the app (with the "West" checked), but now I get the "1252 encoding not found" again. No matter what I do, I can't get rid of it.

Please help.

Tagged:

Best Answer

  • MichieldeKreekMichieldeKreek US ✭✭
    Accepted Answer

    Hi Guilherme,
    Thanks for your answer. Unfortunately, it didn't do the trick.
    In the meantime, I have found a solution --> setting Linking to "SDK assemblies only" helped. Before, it was set to "SDK and User Assemblies". The reason I had set it to SDK + User, was to fix a previous problem --> "The "LinkAssemblies" task failed unexpectedly". I have now found a different solution to this previous problem --> remove reference Xamarin.iOS on the Android project (I'm wondering why it's there at all).

    To be quite honest, this all seems a bit quirky and counter-intuitive to me. But then again, this is my first xamarin project.

Answers

  • MichieldeKreekMichieldeKreek USMember ✭✭

    using (SqlConnection conn = new SqlConnection(dbConnString))
    {
    conn.Open(); // this is where the error occurs
    ...

    I followed the suggested solution posted by JonathanPryor ->
    https://forums.xamarin.com/discussion/25/problem-inserting-data-in-sql-server-in-release-mode

    Unfortunately, still not working.

    Seems like a Xamarin bug to me...

  • GuiWaltrickeGuiWaltricke BRMember ✭✭

    @MichieldeKreek can you make a test?

    go to the Android project, em the properties -> Android Options

    Then Linker Options, in the "Additional supported encodings" check all the options "CJK, Mideast, Rare, West, Other" and test.

    if this works, uncheck one by one, to know who is really necessary

  • MichieldeKreekMichieldeKreek USMember ✭✭
    Accepted Answer

    Hi Guilherme,
    Thanks for your answer. Unfortunately, it didn't do the trick.
    In the meantime, I have found a solution --> setting Linking to "SDK assemblies only" helped. Before, it was set to "SDK and User Assemblies". The reason I had set it to SDK + User, was to fix a previous problem --> "The "LinkAssemblies" task failed unexpectedly". I have now found a different solution to this previous problem --> remove reference Xamarin.iOS on the Android project (I'm wondering why it's there at all).

    To be quite honest, this all seems a bit quirky and counter-intuitive to me. But then again, this is my first xamarin project.

  • TYDOLLASIGNTYDOLLASIGN USMember ✭✭

    For anyone who finds this page with a similar question, I was experiencing a variation of MichieldeKreek's issue.
    Both release and debug modes were working fine, but my deployed .APKs were getting this error.

    My solution: I realized I had created an apk from the the entire solution, which included both the portable and android projects. Simply "Archiving" only the android project for an apk stopped the error from occurring and I haven't run into any resulting issues thus far.

    Although if anyone would care to comment explaining why only the android project is required for an apk, even though it references code from the portable project, that would be greatly appreciated.

  • TYDOLLASIGNTYDOLLASIGN USMember ✭✭

    Follow up: After making this change I found later that I was now receiving the same "1252 encoding not found" error on debug mode. Fortunately, the fix was what I expected. In project properties, none of the additional supported encodings were checked, "CJK, Mideast, Rare, West, Other". I checked them all and the error went away.

Sign In or Register to comment.