Samsung / Android 8.0 Oreo update causing crashes?

FullEnglishFullEnglish GBMember ✭✭
edited September 2018 in Xamarin.Forms

Has anyone else experienced a high number of app crashes with Samsung / Android 8.0 Oreo? We've seen a huge spike specific to Samsung devices running Android 8.0 Oreo and after doing some Googling it seems to be a common problem.

To resolve, the user either has to restart their device, perform a soft reset or clear the cache data for the app.

Is there a way to prevent these crashes? I've thought about attempting to clear the cache pragmatically to see if that helps.

Thoughts?


Answers

  • WilliamWattersonWilliamWatterson USUniversity ✭✭

    @FullEnglish - did you ever get a solution to this? I too have similar crashes for these types of devices

  • FullEnglishFullEnglish GBMember ✭✭

    Yes, we found some calls at startup were causing the issue. Not sure exactly why though?

    When our app boots, we make a call to a server to retrieve some data. This call was happening 3 - 4times instead of just the once and across a couple of threads. Once we'd cleaned this up, it all started working correctly.

  • NMackayNMackay GBInsider, University mod

    @FullEnglish said:
    Yes, we found some calls at startup were causing the issue. Not sure exactly why though?

    When our app boots, we make a call to a server to retrieve some data. This call was happening 3 - 4times instead of just the once and across a couple of threads. Once we'd cleaned this up, it all started working correctly.

    Could you elaborate a little more, this info could be essential to helping others. Was this check in OnResume or platform specific events?

  • FullEnglishFullEnglish GBMember ✭✭

    Sure. This appeared to be an issue with a few xamarin pages all making the same call to our server at start-up. This isn't platform specific, this was in the PCL when the pages were being initialised.

    We added semaphore protection around the call...

                //Asynchronously wait to enter the Semaphore. If no-one has been granted access to the Semaphore, code execution will proceed, otherwise this thread waits here until the semaphore is released 
                await startupResponseSemaphore.WaitAsync();
                if (lastStartupResponse == null)
                {
    

    And also found one suspect task that may not have always been running on the main thread so modified that to run on the main thread:

    All the platform specific boot-up stuff was all OK.

  • NMackayNMackay GBInsider, University mod
    edited February 12

    @FullEnglish said:
    Sure. This appeared to be an issue with a few xamarin pages all making the same call to our server at start-up. This isn't platform specific, this was in the PCL when the pages were being initialised.

    We added semaphore protection around the call...

                //Asynchronously wait to enter the Semaphore. If no-one has been granted access to the Semaphore, code execution will proceed, otherwise this thread waits here until the semaphore is released 
                await startupResponseSemaphore.WaitAsync();
                if (lastStartupResponse == null)
                {
    

    And also found one suspect task that may not have always been running on the main thread so modified that to run on the main thread:

    All the platform specific boot-up stuff was all OK.

    Thanks for clarifying, seen this before of too much been done at app startup and it's difficult not to block the UI thread at startup.

Sign In or Register to comment.