I work with a pretty large enterprise application (around 800k LOC) and a release APK of 65MB. We've only really worked with Android 4.4 KitKat and 5 Lollipop. Recently one of our Samsung devices updated to Android 6 Marshmallow and started exhibiting some freeze up issues. Basically our app runs in Kiosk mode, so we are the home launcher. The user doesn't see or access the android OS. Our app stays running and on throughout the day for our users, so we force the screen to stay on, use wakelocks, etc. Basically when our app is running, after a period of time ranging from 20 minutes to a day, the app will just freeze. The UI will be frozen and our process stops doing work. We also run in two processes, one being a service. The service will keep running, but only process a small amount of data as the two processes are dependent on each other.
What's interesting is that when building our app using Xamarin 3.9, the lock up issue does not occur running the exact same code, same devices. Keep in mind, Xamarin 3.9 was PRE Android 6 Marshmallow. We've got this to reproduce on multiple Android 6 devices so far.
Our app does a lot of logging, and I've spent a lot of time in the Logcat as well, basically living in the Android Device Monitor the last couple of weeks monitoring everything. There is literally nothing in either logs that indicate any sort of issue. The app just stops and freezes. It never triggers an Android "This app is not responding, would you like to close it?" dialog either when it happens. If you try tapping a few times on the screen it will eventually trigger the dialog though.
What I've tried so far:
- Xamarin versions running from 4.0.4.4 to the latest currently (4.2.0.719).
- Changing target/compile to Android 6 and fixed any deprecated/obsolete code.
- Implemented the Android 6 permission scheme thinking it may be a permission issue
- Verified this issue ONLY occurs on Android 6 (doesn't occur on 4.4 or 5 on various devices). Haven't tried 7 yet.
One thing to note, our app uses a lot of permissions, and does try to set the system time along with other system changes. We don't have access to do so on some devices. We have a custom Android device we use as well that we have system privileges over so we can do this.
I am currently in the process of creating a standalone app that mimics some of the things our app does while sitting idle. Mainly running multiprocess with intents getting sent to broadcast receivers to communicate between processes. Hopefully I can recreate it so I can share this app with Xamarin and anyone else interested.
Being this is an enterprise app, my hands are tied as far as what I can share. I have plenty of logcat logs showing where our app falls on its face and can gladly provide snippets of that!
My ask is, anyone have any recommendations to try next? Is there any Xamarin advanced logging I could try? At this point it seems it's Xamarin related due to certain versions of Xamarin having or not having the issue. Though maybe something introduced in Android 6 doesn't like what we're doing. Nothing in the Android 6 release notes seem to hint any major changes that'd effect us.
Sorry for the long post, and appreciate any input! Thanks in advance!