Ai studio bug in build app

I created an app using Google AI Studio and I am running it directly from there. Earlier it was working perfectly, but since the Gemini 3.1 update, I’ve started facing a problem.

Whenever I minimize the app and then reopen it, the app automatically restarts. Sometimes it also restarts while I am actively using it, after a few seconds.

This issue started only after the Gemini 3.1 update. Please help me find a solution or explain what might be causing this problem.