Bug 17690 - Xamarin Apps not running with Swiss German CultureInfo
Summary: Xamarin Apps not running with Swiss German CultureInfo
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.2.x
Hardware: PC Mac OS
: Normal normal
Target Milestone: 7.2.1
Assignee: Marek Safar
URL:
: 18116 18230 ()
Depends on:
Blocks:
 
Reported: 2014-02-10 13:52 UTC by Dani
Modified: 2014-03-19 09:10 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
iOS CrashLog (79.92 KB, application/octet-stream)
2014-02-10 13:52 UTC, Dani
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Dani 2014-02-10 13:52:25 UTC
Created attachment 6017 [details]
iOS CrashLog

Steps to reproduce:
 - got to iPhone Settings --> General --> International --> Region Format --> Swiss German(Switzerland)
 - start almost any Xamarin App (eg Tasky)

App crashes after launch image.
NSNumberFormatter runs into an infinit loop trying to ConstructCurrentCulture (see StackTrace below).
--------------

Workaround (very ugly, but hey... ;) ):
Main.cs:
	public class Application
	{
		// This is the main entry point of the application.
		static void Main (string[] args)
		{
			NSUserDefaults.StandardUserDefaults ["AppleLanguages"] = NSArray.FromStrings ("de");
			NSUserDefaults.StandardUserDefaults.Synchronize ();
			CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture ("de-DE");
			UIApplication.Main (args, null, "AppDelegate");
		}
	}
Comment 1 Nischal 2014-02-11 02:15:46 UTC
We have checked and able to reproduce this issue when Region Format is set as 
Swiss German(Switzerland). 

Checked on device: iPhone 4 (iOS 6.1.3)
Supplement Info: 
iOS Device Log: https://gist.github.com/saurabh360/d8074fdb01cc53744dda
Build Output: https://gist.github.com/saurabh360/2bb877644997cfddf42c

Environment Info:
XS 4.2.2 (build 2)
Build Information
Git revision: c5f82958ae7d9af652b44b87ceff777b3ad19b91
Xamarin addins: a4044fee09138f6fd031a9944b7caaeb51e57e80
Xam.iOS 7.0.6-168
Comment 2 Dani 2014-02-11 05:56:45 UTC
Oh, Forgot to mention:
Tested on:
 - iPhone 4 (iOS 7.0.2)
 - iPhone 5s (iOS 7.0.4)

Xamarin Studio
Version 4.2.2 (build 2)
Git revision: c5f82958ae7d9af652b44b87ceff777b3ad19b91
Xamarin addins: a4044fee09138f6fd031a9944b7caaeb51e57e80

Apple Developer Tools
Xcode 5.0.2 (3335.32)
Build 5A3005

Xamarin.iOS
Version: 7.0.6.168 (Indie Edition)
Comment 3 Marek Safar 2014-02-16 12:15:20 UTC
Fixed in master
Comment 4 Mikael Carlstein 2014-02-24 11:13:33 UTC
I have the same problem. 

Any solution ? 

I need to support different language , so the fix wont work for me :( 

// 
Mike
Comment 5 Dani 2014-02-27 10:44:47 UTC
hmm... sadly the patch is not in the current update yet.

i found that just changing 
----
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture ("de-DE");
----
is enough to make the app runnable.
Depending on your internationalisation model different languages should still be supported.

NSLocale.PreferredLanguages and NSLocale.CurrentLocale stay untouched by the workaround.
Comment 6 Mikael Carlstein 2014-02-28 03:50:54 UTC
Yes. 

But i have a cross plattform solution so i want to use the 
System.Globalization.CultureInfo.CurrentUICulture. 

But i gave up and created a interface and use 
NSLocale.CurrentLocale 


//
Mike
Comment 7 Rolf Bjarne Kvinge [MSFT] 2014-03-03 09:25:52 UTC
*** Bug 18116 has been marked as a duplicate of this bug. ***
Comment 8 Rolf Bjarne Kvinge [MSFT] 2014-03-06 20:09:24 UTC
*** Bug 18230 has been marked as a duplicate of this bug. ***
Comment 9 Christer Nordvik 2014-03-07 03:38:58 UTC
Are there any other workaround? The line: 
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture
("de-DE");

Will affect how dates are outputted in the app so it's not a solution for me :-/ 

Shouldn't this be released as a hotfix in the stable version?
Comment 10 Rolf Bjarne Kvinge [MSFT] 2014-03-07 05:31:18 UTC
@Christer: we're working on getting this released. In the meantime you can downgrade to an earlier version of Xamarin.iOS (I believe 7.0.5 should work) by downloading earlier versions from your Xamarin Store account (https://store.xamarin.com/account/my/subscription/downloads).
Comment 11 Christer Nordvik 2014-03-11 08:44:53 UTC
Is this also fixed for other regions like "Bosnian -> Bosnia and Herzegovina"? We just had a user switching from that one to "Bosnia and Herzegovina" to make it work.
Comment 12 Rolf Bjarne Kvinge [MSFT] 2014-03-11 13:50:28 UTC
@Christer: AFAIK this only occurred with Swiss -> German.
Comment 13 Christer Nordvik 2014-03-11 16:38:37 UTC
Can you recheck this fix with the "Bosnian -> Bosnia and Herzegovina" region set and see if the fix also fixes the issue for this region? If I set ""Bosnian -> Bosnia and Herzegovina" I get the same immediate crash that I have with Swiss -> German.
Comment 14 Nischal 2014-03-12 02:29:20 UTC
Checked, this issue also exit when Region Format is set as :
Bosnian -> Bosnia and Herzegovina
Bosnian -> Bosnia and Herzegovina (Cyrillic)

Checked on device: iPhone 4 (iOS 7.0.4)
Supplement Info: 
iOS Device Log: https://gist.github.com/saurabh360/200a7d17b2e25d99a129

Environment Info:
XS 4.2.3 (build 60)
Build Information
Git revision: 30c4afc300c2a39ec5300851357ce02e49dd217e
Xamarin addins: f8a9589b57c2bfab2ccd73c880e7ad81e3ecf044
Xam.iOS 7.0.7.2
Comment 15 Nischal 2014-03-19 09:10:38 UTC
Now Xamarin app (Tasky) runs successfully with Swiss German and Bosnian -> Bosnia and Herzegovina, Bosnian -> Bosnia and Herzegovina (Cyrillic) region formats.

Environment Info:
XS 4.2.4 (build 32)
Build Information
Git revision: a160c35dac9ab9fd32eeadaa171216316d5a5133
Xamarin addins: a779416ceabd54981ce812771a4061c942e8b872
Xam.iOS 7.2.1.20