0

I'm using UrbanAirShip library, I wrote the init part of urbanairship in the Application class. Where in my launcher activity i used the sharedpreferences. Because of using the UrbanAirShip it was causing ANR at the point of accessing the Shared Preferences in my app.

I dont why. Please help me.

user3607798
  • 769
  • 2
  • 7
  • 15

1 Answers1

0

I came across a similar issue scenario when I was integrating a custom login sdk, which was using a rx blockable call.

Based on ANR logs on Google Play Console, I made a reasearch and found those links:

In my case , the problem happens when I call shared() on single Urban instance which uses tons of synchronized method, which locks disk reads, to content providers and preferences files.

Try to initialize Urban later at onCreate of your Application class, and run any heavy I/O, perhaps blocking operation, later in an async manner, since you can't block main thread too. Hope it helps!

william gouvea
  • 554
  • 4
  • 6