Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.31k stars 2.74k forks source link

[HybridApp] ANR triggered by main thread waiting for too long #46836

Closed AndrewGable closed 1 month ago

AndrewGable commented 1 month ago

Problem

We are receiving ANR triggered by main thread waiting for too long on HybridApp.

Steps:

  1. Use HybridApp version 9.0.13.4 or greater
  2. Use Expensify classic
  3. Enable location permissions via Inbox task
  4. Go to expenses page
  5. Take a SmartScan from the floating action button
  6. Refresh expense list
  7. See that the UI is blocked
  8. Eventually Android OS will say Expensify isn't responding

https://github.com/user-attachments/assets/c8330038-3c42-481e-b212-fdd4766b4470

Solution

I believe updating the function LocationManager.getLastLocation which uses the depreciated method: FusedLocationApi.getLastLocation will fix the issue: https://stackoverflow.com/a/76266778

AndrewGable commented 1 month ago

cc @staszekscp @mateuuszzzzz - Do either of you want to look into this one?

AndrewGable commented 1 month ago

Firebase link: https://console.firebase.google.com/project/expensify-mobile-app/crashlytics/app/android:org.me.mobiexpensifyg/issues/74f04c8fadf3c920bb917f0f5e25959b?time=last-ninety-days&sessionEventKey=66B0F9A4031600013437F17580E8C8E1_1978134475913607661

staszekscp commented 1 month ago

Done!

Julesssss commented 1 month ago

Reopening the issue. Code fix has been made but we need to test this within a Hybrid app build.

melvin-bot[bot] commented 1 month ago

@staszekscp Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!