Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report - ANR - Input dispatching timed out at DatabaseHandler.java:943 #214

Open
GrazianoCapelli opened this issue Jan 20, 2024 · 0 comments
Labels
bug A bug of the App, it needs to be fixed soon

Comments

@GrazianoCapelli
Copy link
Member

GrazianoCapelli commented Jan 20, 2024

Input dispatching timed out
at sun.misc.Unsafe.park (Native method)
at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230)
at android.database.sqlite.SQLiteConnectionPool.waitForConnection (SQLiteConnectionPool.java:756)
at android.database.sqlite.SQLiteConnectionPool.acquireConnection (SQLiteConnectionPool.java:380)

This function call is performing I/O operations, which have unpredictable timing

at android.database.sqlite.SQLiteSession.acquireConnection (SQLiteSession.java:896)
at android.database.sqlite.SQLiteSession.prepare (SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram. (SQLiteProgram.java:61)
at android.database.sqlite.SQLiteQuery. (SQLiteQuery.java:37)
at android.database.sqlite.SQLiteDirectCursorDriver.query (SQLiteDirectCursorDriver.java:46)
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory (SQLiteDatabase.java:1545)
at android.database.sqlite.SQLiteDatabase.rawQuery (SQLiteDatabase.java:1484)
at eu.basicairdata.graziano.gpslogger.DatabaseHandler.getTrack (DatabaseHandler.java:943)

Your app code here involves the I/O call shown above. The code that triggers I/O operations must be moved off the main thread.

at eu.basicairdata.graziano.gpslogger.Exporter. (Exporter.java:172)
at eu.basicairdata.graziano.gpslogger.GPSApplication.executeExportingTask (GPSApplication.java:1641)
at eu.basicairdata.graziano.gpslogger.GPSApplication$5.run (GPSApplication.java:364)
at eu.basicairdata.graziano.gpslogger.GPSApplication.startExportingStatusChecker (GPSApplication.java:1621)
at eu.basicairdata.graziano.gpslogger.GPSApplication.executeJob (GPSApplication.java:1711)
at eu.basicairdata.graziano.gpslogger.FragmentTracklist.onEvent (FragmentTracklist.java:221)

at java.lang.reflect.Method.invoke (Native method)
at org.greenrobot.eventbus.EventBus.invokeSubscriber (EventBus.java:510)
at org.greenrobot.eventbus.EventBus.postToSubscription (EventBus.java:433)
at org.greenrobot.eventbus.EventBus.postSingleEventForEventType (EventBus.java:414)
at org.greenrobot.eventbus.EventBus.postSingleEvent (EventBus.java:387)
at org.greenrobot.eventbus.EventBus.post (EventBus.java:268)
at eu.basicairdata.graziano.gpslogger.ToolbarActionMode.onActionItemClicked (ToolbarActionMode.java:102)
at androidx.appcompat.app.AppCompatDelegateImpl$ActionModeCallbackWrapperV9.onActionItemClicked (AppCompatDelegateImpl.java:2718)
at androidx.appcompat.view.StandaloneActionMode.onMenuItemSelected (StandaloneActionMode.java:140)
at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected (MenuBuilder.java:836)
at androidx.appcompat.view.menu.MenuItemImpl.invoke (MenuItemImpl.java:159)
at androidx.appcompat.view.menu.MenuBuilder.performItemAction (MenuBuilder.java:987)
at androidx.appcompat.view.menu.MenuBuilder.performItemAction (MenuBuilder.java:977)
at androidx.appcompat.widget.ActionMenuView.invokeItem (ActionMenuView.java:625)
at androidx.appcompat.view.menu.ActionMenuItemView.onClick (ActionMenuItemView.java:156)
at android.view.View.performClick (View.java:7503)
at android.view.View.performClickInternal (View.java:7480)
at android.view.View.access$3600 (View.java:813)
at android.view.View$PerformClick.run (View.java:28445)
at android.os.Handler.handleCallback (Handler.java:938)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loop (Looper.java:223)
at android.app.ActivityThread.main (ActivityThread.java:7986)
at java.lang.reflect.Method.invoke (Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:603)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:947)

Problem:

The main thread was busy with an I/O operation. The problem may be due to network or file access (particularly compressed files), but also operations such as ClassLoader.loadClass.

Advise:

I/O operations are very unpredictable and can block a thread for a long time. Avoid I/O in the main thread and refactor your code so that I/O operations are performed in a separate thread from the main thread

@GrazianoCapelli GrazianoCapelli added the bug A bug of the App, it needs to be fixed soon label Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug of the App, it needs to be fixed soon
Projects
None yet
Development

No branches or pull requests

1 participant