Open adityameesho opened 11 months ago
Hi @adityameesho,
Initializing Cronet can be fairly expensive as it involves loading a non-trivial amount of Java code as well as the native library (which requires its own initialization as well). For this reason, it might indeed be a good idea to do it in a background thread to avoid blocking the UI on the loading process, which could potentially result in ANRs especially if the device is slow or starved of resources (e.g. during app startup).
Sharing some of the ANRs encountered when calling
CronetProviderInstaller
and when callingbuild
method ofCronetEngine.Builder
andCronetInterceptor
There is one ANR happening due to
System.loadLibrary
being called on main thread by Play Services.Is it safe to call the
CronetProviderInstaller.installProvider()
on a background thread?anr_load_library.txt anr1.txt anr2.txt anr3.txt