Android reporting ANR on the CookieManager.getInstance()

Viewed 12

I am facing an ANR issue when I try to get the instance of CookieManager in android. As per the firebase this issue is mostly reported in android 11 and 12.

In my code I am just trying to get the instance of the cookie manager.

 try {
                cookieManager = CookieManager.getInstance();
                cookieManager.setAcceptCookie(true);
            } catch (Exception e) {
               Logger.e(e, "Cannot init CookieManager");
            }

Below is the firebase logs for the same.

 main (native): tid=1 systid=9621 
    #00 pc 0x4c4ac libc.so (syscall + 28)
    #01 pc 0x47cc80 libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 140)
    #02 pc 0x55d7f4 libart.so (artQuickGenericJniEndTrampoline + 1156)
    #03 pc 0x440564 libart.so (art_quick_generic_jni_trampoline + 164)
    #04 pc 0x2ea2f58 memfd:jit-zygote-cache (android.webkit.WebViewLibraryLoader.loadNativeLibrary + 232)
    #05 pc 0x2e9fcd4 memfd:jit-zygote-cache (android.webkit.WebViewFactory.getProviderClass + 1300)
    #06 pc 0x2e9f11c memfd:jit-zygote-cache (android.webkit.WebViewFactory.getProvider + 716)
    #07 pc 0x2e978e4 memfd:jit-zygote-cache (android.webkit.CookieManager.getInstance + 36)
           at android.webkit.WebViewLibraryLoader.nativeLoadWithRelroFile(Native method)
           at android.webkit.WebViewLibraryLoader.loadNativeLibrary(WebViewLibraryLoader.java:214)
           at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:512)
           at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:348)
           at android.webkit.CookieManager.getInstance(CookieManager.java:50)
0 Answers
Related