wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.99k stars 1.33k forks source link

ApplicationNotResponding in UserAgent #12259

Open oguzkocer opened 4 years ago

oguzkocer commented 4 years ago

ANRs weren't available in Sentry until the last release, so this issue is not newly introduced. Please keep that in mind while debugging the issue so as not to limit it to the changes introduced recently.

Sentry Url: https://sentry.io/share/issue/09ee294fc5b3453bb0b2920117ae4387/ User Count: 712 Count: 1339 First Release: org.wordpress.android@15.0-rc-1+874 First Seen: 2020-06-03T13:44:42.073000Z Last Seen: 2020-06-24T01:23:36Z 24 Hours: 296 30 Days: 1334

ApplicationNotResponding: Application Not Responding for at least 5000 ms.
     at org.wordpress.android.fluxc.network.UserAgent.<init>(UserAgent.java:18)
     at org.wordpress.android.modules.AppConfigModule.provideUserAgent(AppConfigModule.java:22)
     at org.wordpress.android.modules.AppConfigModule_ProvideUserAgentFactory.provideUserAgent(AppConfigModule_ProvideUserAgentFactory.java:37)
     at org.wordpress.android.modules.AppConfigModule_ProvideUserAgentFactory.get(AppConfigModule_ProvideUserAgentFactory.java:27)
     at org.wordpress.android.modules.AppConfigModule_ProvideUserAgentFactory.get(AppConfigModule_ProvideUserAgentFactory.java:10)
     at org.wordpress.android.fluxc.module.ReleaseNetworkModule_ProvideAccountRestClientFactory.get(ReleaseNetworkModule_ProvideAccountRestClientFactory.java:61)
     at org.wordpress.android.fluxc.module.ReleaseNetworkModule_ProvideAccountRestClientFactory.get(ReleaseNetworkModule_ProvideAccountRestClientFactory.java:15)
     at org.wordpress.android.fluxc.store.AccountStore_Factory.get(AccountStore_Factory.java:44)
     at org.wordpress.android.fluxc.store.AccountStore_Factory.get(AccountStore_Factory.java:12)
     at org.wordpress.android.modules.DaggerAppComponent.injectWordPress(DaggerAppComponent.java:5578)
...
(28 additional frame(s) were not displayed)
stale[bot] commented 3 years ago

This issue has been marked as stale because:

Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority during regularly scheduled triage sessions.

sentry-io[bot] commented 8 months ago

Sentry Issue: WORDPRESS-ANDROID-2VFK

dangermattic commented 8 months ago

Thanks for reporting! 👍

antonis commented 7 months ago

Probably fixed with https://github.com/wordpress-mobile/WordPress-Android/pull/20296 since there are no occurrences after 24.3.1. Feel free to reopen if the issue persist

sentry-io[bot] commented 7 months ago

Sentry Issue: JETPACK-ANDROID-P3K

sentry-io[bot] commented 7 months ago

Sentry Issue: WORDPRESS-ANDROID-2VYY

sentry-io[bot] commented 7 months ago

Sentry Issue: JETPACK-ANDROID-NWK

antonis commented 7 months ago

Probably fixed with https://github.com/wordpress-mobile/WordPress-Android/pull/20296 since there are no occurrences after 24.3.1. Feel free to reopen if the issue persist

I'm reopening this issue since the ANR still persist after the fix and is related to a know limitation of the getDefaultUserAgent call https://issuetracker.google.com/issues/289118199#comment9

The issue seems to occur almost exclusively on low end devices.

sentry-io[bot] commented 7 months ago

Sentry Issue: WORDPRESS-ANDROID-23MM

sentry-io[bot] commented 7 months ago

Sentry Issue: JETPACK-ANDROID-N3J

sentry-io[bot] commented 7 months ago

Sentry Issue: WORDPRESS-ANDROID-2WA6

sentry-io[bot] commented 7 months ago

Sentry Issue: WORDPRESS-ANDROID-2WCX

sentry-io[bot] commented 7 months ago

Sentry Issue: WORDPRESS-ANDROID-2WA4

antonis commented 7 months ago

The ANR roots in two places:

  1. The AppConfigModule that uses the FluxC implemantation.

    io.sentry.android.core.ApplicationNotResponding: Background ANR
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:509)
    at WV.ir.<init>(chromium-TrichromeWebViewGoogle6432.aab-stable-626111933:43)
    at WV.rC.<init>(chromium-TrichromeWebViewGoogle6432.aab-stable-626111933:8)
    at org.chromium.android_webview.AwBrowserProcess.f(chromium-TrichromeWebViewGoogle6432.aab-stable-626111933:106)
    at com.android.webview.chromium.M.e(chromium-TrichromeWebViewGoogle6432.aab-stable-626111933:208)
    at com.android.webview.chromium.M.b(chromium-TrichromeWebViewGoogle6432.aab-stable-626111933:42)
    at com.android.webview.chromium.WebViewChromiumFactoryProvider.getStatics(chromium-TrichromeWebViewGoogle6432.aab-stable-626111933:16)
    at android.webkit.WebSettings.getDefaultUserAgent(WebSettings.java:1355)
    at org.wordpress.android.fluxc.network.UserAgent.<init>(UserAgent.kt:17)
    at org.wordpress.android.modules.AppConfigModule.provideUserAgent(AppConfigModule.java:30)
  2. The AppInitialiser.

    io.sentry.android.core.ApplicationNotResponding: Background ANR
    at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:227)
    at android.webkit.WebSettings.getDefaultUserAgent(WebSettings.java:1355)
    at org.wordpress.android.AppInitializer$Companion$defaultUserAgent$2.invoke(AppInitializer.kt:1065)
    at org.wordpress.android.AppInitializer$Companion$defaultUserAgent$2.invoke(AppInitializer.kt:1063)
    at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
    at org.wordpress.android.AppInitializer$Companion.getDefaultUserAgent(AppInitializer.kt:1063)
    at org.wordpress.android.AppInitializer$Companion$userAgent$2.invoke(AppInitializer.kt:1097)
    at org.wordpress.android.AppInitializer$Companion$userAgent$2.invoke(AppInitializer.kt:1096)
    at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
    at org.wordpress.android.AppInitializer$Companion.getUserAgent(AppInitializer.kt:1096)
    at org.wordpress.android.AppInitializer.init(AppInitializer.kt:308)
    at org.wordpress.android.WordPressApp.onCreate(WordPressApp.java:20)
irfano commented 7 months ago

@antonis, is your investigation ongoing? Can I assign this issue and WORDPRESS-ANDROID-2WA6 to you?

antonis commented 7 months ago

Hey @irfano 👋 I'll be glad to continue looking at this. I've requested feedback internally (ref pcdRpT-5Us-p2#comment-9676) to see if we can avoid calling getDefaultUserAgent on initialisation when possible. I think that this might also be one of the root causes of https://github.com/wordpress-mobile/WordPress-Android/issues/20147

sentry-io[bot] commented 7 months ago

Sentry Issue: JETPACK-ANDROID-P8V

sentry-io[bot] commented 6 months ago

Sentry Issue: JETPACK-ANDROID-Q96

sentry-io[bot] commented 6 months ago

Sentry Issue: WORDPRESS-ANDROID-2Y27

sentry-io[bot] commented 6 months ago

Sentry Issue: JETPACK-ANDROID-QTP

antonis commented 6 months ago

Reopening since the issue persist after https://github.com/wordpress-mobile/WordPress-Android/pull/20603:

The rate seems lower but I'll keep monitoring how this evolves.

sentry-io[bot] commented 6 months ago

Sentry Issue: JETPACK-ANDROID-R42

antonis commented 6 months ago

Added the SSLCertsViewActivity related crashes in a separate issue https://github.com/wordpress-mobile/WordPress-Android/issues/20786

sentry-io[bot] commented 5 months ago

Sentry Issue: JETPACK-ANDROID-S38

sentry-io[bot] commented 5 months ago

Sentry Issue: WORDPRESS-ANDROID-2YC7

sentry-io[bot] commented 5 months ago

Sentry Issue: JETPACK-ANDROID-RG5