ArgumentException: get_dataPath 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.
Procedure..ctor ()
It points to a game object which only has one script on it. But it does not give me any real information on how to fix the problem. If it does, I can’t tell.
Hi Dreamora,
Can you please elaborate on this?
I get this error message when I build my Unity application into a standalone, but I have no clue where to look for the problem?
Thank you,
There is one not obvious case, error occur if you play it in editor:
//This is cause:
private string ps_path = "URI=file:" + Application.dataPath + "/database.db";
public Text txt_DataPath;
public Text txt_DbExist;
public Text txt_Error;
// Use this for initialization
void Start()
{
//You should do this:
ps_path = "URI=file:" + Application.dataPath + "/database.db";
}