Search Issue Tracker

Fixed in 2018.3

Fixed in 2017.4, 2018.1, 2018.2

Votes

0

Found in

2017.2.1p4

Issue ID

1028371

Regression

No

[Android][UnityWebRequest] UnityWebRequest logs java exceptions as Unity errors on Android devices

Mobile

-

On Android, when UnityWebRequest throws a java exception, it is caught and logged as a Unity error, even for common failures like no internet connection

To reproduce:

1. Download attached project "UWR_Logs_Errors_On_Android.zip" and open in Unity
2. Open "Test" scene
3. Enter Play mode
4. Press "Google.com" button
5. Observe that in Console there will be printed two logs - "Starting" and "Finished"
6. Turn off Internet
7. Press "Google.com" button
8. Observe that in Console there will be printed three logs - "Starting", "UWR.error: Cannot resolve destination host" and "Finished"
9. Exit Play mode
10. Run logcat
11. Build and run the project on an Android device
12. Press "Google.com" button
13. Observe that in logcat there will be thrown two logs - "Starting" and "Finished"
14. Turn off the Internet in Device
15. Press "Google.com" button
16. Observe that in logcat there will be printed four logs - "Starting", "java.net.UnknownHostException: Unable to resolve host "www.google.com": No address associated with hostname", "UWR.error: Cannot resolve destination host" and "Finished"

Reasons to change this behavior:
- Clutters analytics data as it's reported as the same severity as issues that are more important, e.g., a Scene failed to load.
- Already have UnityWebRequest.error for handling errors, confusing to also log it as a unity error.
- Different behavior to other platforms, as Editor and iOS don't log unity errors for UWR failures.

Notes:
- Logcat is shared in the comments section
- This issue is reproducible only in Android devices
- This issue is not reproducible in iOS devices
- This issue is not reproducible in Windows and OSX Standalones
- This issue is not reproduced in Editor

Devices:
- Google Pixel 2, OS: 8.1.0, CPU: arm64-v8a, GPU: Adreno (TM) 540 - Reproduced
- Samsung Galaxy Note 8, OS: 7.1.1, CPU: arm64-v8a, GPU: Adreno (TM) 540 - Reproduced
- iPhone 7, iOS: 11.2.6, CPU: A10 - Not Reproduced

Reproduced on Unity 2017.2.1p4, 2017.2.2p3, 2017.3.2f1, 2017.4.1f1, 2018.1.0f1 and 2018.2.0b1

Fixed in: 2017.4.5f1, 2018.1.3f1, 2018.2.0b5, 2018.3.0a1

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.