Q:

if (File. Exists(Application.persistentDataPath + localUserFileName)) hangs application

if (File. Exists(Application.persistentDataPath + localUserFileName))   

hangs application
Unity Version 2018.3.0f2
It worked in pre 2018.3 versions
The issue seems to be with Application.persistentDataPath, because the following line causes app hang as well. 
Debug. Log("Application.persistentDataPath " + Application.persistentDataPath);  

Is there a way to solve this issue without downgrading Unity? 
No error logs are produced in the console. 
As @andrew-%c5%81ukasik suggested, I tested following code. 
try
{
    Debug. Log("Application.persistentDataPath " + Application.persistentDataPath);
}
catch (System. Exception ex)
{
    Debug. LogException(ex);
}

Now, there are two errors in the console:
1.  GetGfxDevice() should only be called from main thread (this error refers to the line in catch block)
2.  UnityException: get_persistentDataPath can only be called from the main thread. 
Constructors and field initializers will be executed from the loading thread when loading a scene. 
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function. ( this error refers to the line in try block.) 
This is not a duplicate of Download and save image into Application.persistentDataPath hangs the app Because the hanging problem on the previous one is related to downloading from url and saving to local file.  However this one is pure local process. 

A:

Put this code inside try-catch block:
try
{
    /* here */
} catch( System. Exception ex )
{
    Debug. LogException(ex);
    //you can add additional code here to handle this exception
    //example: break loop (especially when it's infinite one), stop method execution, etc. 
}

Sometimes code throws exceptions that are not being catched by unity.  This happens when code is not executed on main thread for example. 
Also open editor raw log files, any evidence of errors will be there

