I have a production application based on Android Kotlin which supports API level 10 or higher. This applications is for EPOS machines. This has got a lot of ANR's and crashes reported in the firebase consoles on all activities and fragments. I have tried everything to remove this including bringing the leaks to 0 in profiler and removing all the unnecessary code. The memory management also seems to be working fine as running the app for 30 mins and regularly working on the application. The memory doesn't go beyond 200 MB.
This app has got multiple capabilities including payment module for connecting to card reader and taking payment. Printer for printing receipts. Cash Drawer support and multiple screen support for customers to look at their orders.
The issue was fixed. This app was for EPOS devices with multiple screens. The code was alright. The issue was with the secondary screen on the device. The secondary screen had a huge memory leak which was causing this issue. We did some changes to the code for secondary screen and this was fixed. We were not able to check the memory leaks for the device because we were not able to connect the laptop with devices directly. There seems to be no issue with the code that was causing this.