Search Issue Tracker

By Design

Votes

0

Found in

2019.4

2020.3

2020.3.1f1

2021.1

2021.2

Issue ID

1325001

Regression

No

[Mobile] Loading a JSON from Resources folder into a TextAsset fails on some devices

Mobile

-

How to reproduce:
1. Open the user's attached project "New Unity Project (1)"
2. Change the device's locale to something other than the default English one
3. Build and Run to the device

Expected result: "New Text" appears in the Scene
Actual result: Multiple lines of text appear in the Scene

Reproducible with: 2019.4.29f1, 2020.3.15f2, 2021.1.16f1, 2021.2.0b6, 2022.1.0a4

Reproducible on:
VLNQA00381, Xiaomi Redmi Note 8 Pro (Redmi Note 8 Pro), Android 9, CPU: MediaTek Helios G90T MT6785T, GPU: Mali-G76 MC4
VLNQA00004, Meizu MX5 (MX5), Android 5.0.1, CPU: MediaTek Helio X10 MT6795T, GPU: PowerVR Rogue G6200
VLNQA00099, Google Pixel XL (Pixel XL), Android 10, CPU: Snapdragon 821 MSM8996 Pro, GPU: Adreno (TM) 530
VLNQA00052, Xiaomi MI MAX (MI MAX), Android 7.0, CPU: Snapdragon 617 MSM8952, GPU: Adreno (TM) 510
iPhone 12 Pro (iOS 14.2.1)

Notes:
- According to the user on devices where a non-English locale is installed it cannot parse a float number with a dot "1.0", but instead requires a comma "1,0"

  1. Resolution Note (2022.1.X):

    User pointed out the issue, which is:

    2021-08-17 14:37:47.907 15625-20450/com.DefaultCompany.NewUnityProject1 E/Unity: FormatException: Input string was not in a correct format.
    at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x00000] in <00000000000000000000000000000000>:0
    at System.Number.ParseSingle (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00000] in <00000000000000000000000000000000>:0
    at System.Single.Parse (System.String s) [0x00000] in <00000000000000000000000000000000>:0
    at NewBehaviourScript.LoadNPC () [0x00000] in <00000000000000000000000000000000>:0

    When app is run on device that is non-English, such as Lithuanian, you may bet errors in users parser, because floats are parsed using current culture, rather than invariant culture, hence different decimal separator is expected resulting in exception being thrown.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.