question

VuyiswaMaseko-8882 avatar image
0 Votes"
VuyiswaMaseko-8882 asked RobCaplan edited

System.Globalization.CultureNotFoundException: Culture name zm is not supported. Parameter name: name

Good Day

i get this error reported in Appcentre and the device profile is the following

{
"length": 0,
"offset": 0, ,
"exception": {
"type": "System.Globalization.CultureNotFoundException",
"message": "Culture name zm is not supported.\nParameter name: name",
"stackTrace": " at System.Globalization.CultureInfo..ctor (System.String name, System.Boolean useUserOverride, System.Boolean read_only) [0x00073] in <1b39a03c32ec46258a7821e202e0269f>:0 \n at System.Globalization.CultureInfo.GetCultureInfo (System.String name) [0x00038] in <1b39a03c32ec46258a7821e202e0269f>:0 \n at System.Globalization.RegionInfo..ctor (System.String name) [0x0001e] in <1b39a03c32ec46258a7821e202e0269f>:0 \n at XamarinCountryPicker.ViewModels.AboutViewModel..ctor () [0x00072] in <85954eb968de4c5190b623942df5c30f>:0 ",
"wrapperSdkName": "appcenter.xamarin"
},
"isTestMessage": false,
"timestamp": "2021-09-16T10:43:08.514Z",
"device": {
"sdkName": "appcenter.android",
"sdkVersion": "4.2.0",
"wrapperSdkVersion": "4.3.0",
"wrapperSdkName": "appcenter.xamarin",
"model": "TECNO CG6",
"oemName": "TECNO MOBILE LIMITED",
"osName": "Android",
"osVersion": "11",
"osBuild": "RP1A.200720.011",
"osApiLevel": 30,
"locale": "en_US",
"timeZoneOffset": 120,
"screenSize": "720x1428",
"appVersion": "1.81",
"carrierName": "Airtel",
"carrierCountry": "zm",
"appBuild": "81",
}
}

and this fails in this code


     try
     {
         I18N.Current
       .SetResourcesFolder("Locales") // Optional: The directory containing the resource files (defaults to "Locales")
       .Init(GetType().GetTypeInfo().Assembly); // assembly where locales live
         GenericMethods.DEFAULT_LOCALE = DependencyService.Get<IServiceImei>().GetDefaultLanguage();

         if (GenericMethods.USER_DATA != null)
             I18N.Current.Locale = GenericMethods.Convert_Language_to_Locale(GenericMethods.DEFAULT_LOCALE);

         string CountryCode = GenericMethods.DEFAULT_LOCALE = DependencyService.Get<IServiceImei>().GetDefaultCountry();

         Title = "About";

         RegionInfo myRI1 = new RegionInfo(CountryCode);
         string Country = myRI1.TwoLetterISORegionName.ToString();
         SelectedCountry = CountryUtils.GetCountryModelByName(Country);
         ShowPopupCommand = new Command(async _ => await ExecuteShowPopupCommand());
         CountrySelectedCommand = new Command(country => ExecuteCountrySelectedCommand(country as CountryModel));
     }
     catch(Exception ex)
     {
         Task.Run(() => Crashes.TrackError(ex));
     }


This works perfectly well with all other countries but with the following


System.Globalization.CultureNotFoundException: Culture name tz is not supported. Parameter name: name

System.Globalization.CultureNotFoundException: Culture name bj is not supported. Parameter name: name

System.ArgumentException: Region name tg is not supported. Parameter name: name

System.Globalization.CultureNotFoundException: Culture name mz is not supported. Parameter name: name

System.Globalization.CultureNotFoundException: Culture name na is not supported. Parameter name: name


Gives this error

Thanks





dotnet-xamarin
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please try to run your application in local build environment, If you will get same issue, If not, this issue just happened in AppCenter, you can get a free support in Appcenter directly.https://docs.microsoft.com/en-us/appcenter/help#accessing-app-center-free-support

0 Votes 0 ·

0 Answers