My published Windows Phone 8.1 app crashes on start for some users

240 Views Asked by At

recently I've released my new app on Windows Phone Store named "TimeNoti". For most of the users its working great but some of the users are complaining that it crashes on start and all these users are from Europe region like Sweden, Finland and Germany. Is there anything I'm missing? App works great on all phones from other regions but it is unable to start on same phones from Europe region.

I'm attaching a link to my app. Link: http://www.windowsphone.com/s?appid=8e998c15-9813-4411-bd7b-76f397f13fcb

Thanks in advance.

Regard, Richard George

1

There are 1 best solutions below

0
On

After finding the main problem, I tried to figure out its substitution.

The problem is with the DateTimeZone CurrentTZ = DateTimeZoneProviders.Tzdb.GetSystemDefault(); giving exception when phone's language is set to non-English language (Finnish in this case). After searching a lot about this I'm unable to find a proper solution, so I created my own solution.

Solution:

Replaced

Instant Current = SystemClock.Instance.Now;
DateTimeZone CurrentTZ = DateTimeZoneProviders.Tzdb.GetSystemDefault();
ZonedDateTime ZDT = Current.InZone(CurrentTZ);     
Result = ZDT.WithZone(TargetDTZ);

With

LocalDateTime Current = LocalDateTime.FromDateTime(DateTime.UtcNow); 
DateTimeZone CurrentTZ = DateTimeZoneProviders.Tzdb["Etc/GMT"];
ZonedDateTime ZDT = Current.InZoneLeniently(CurrentTZ); 
Result = ZDT.WithZone(TargetDTZ); 

I know this is not the cleanest solution of this problem but it works. If anyone here wanna give better solution to my problem then I'm happy to accept it.