Native activity ANR when system dialog shown. 1.9 RC1

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
diamondcm
Gnoblar
Posts: 22
Joined: Tue May 24, 2011 10:14 am

Native activity ANR when system dialog shown. 1.9 RC1

Post by diamondcm » Tue Aug 27, 2013 3:34 pm

Hi all,

This is really tough, hard to find the problem.

I am using 1.9 RC1 to build my project. Everything goes so well except System UI dialog shown. For example, I call "quit or cancel" UI dialog when users press the return button. The UI is shown pretty good. But after about 5 seconds, the whole game ANR! This anr appears not only in this case. If I make JNI calls to show third-party payment UI, after 5 seconds, the game ANR also!
So do I miss any configuration about native activity to avoid this ANR? Or any thread operation is needed when calling main-thread UI of android? Or is there anything I missed when ogre rendering frame and android UI both shown?
Thank you all so much. This problem make me crazy for more than 1 month.
0 x

User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 1
Contact:

Re: Native activity ANR when system dialog shown. 1.9 RC1

Post by mmixLinus » Fri Sep 06, 2013 12:35 pm

Hi

If you do a blocking call in the Main thread (UI thread), and the Main thread is sent a UI event (for example a key press (touch the screen)) you will get an ANR if you don't handle the UI event within 5 seconds. It seems your Main thread stops handling events when you show the popup. So either your popup is modal and opened in the main thread or your main thread event loop is getting stuck for some other reason. You need to reply to all events within 5 seconds!

Android ANRs

/mmixLinus
0 x
Powered by Ogre3D:
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook

Post Reply