Localization icon indicating copy to clipboard operation
Localization copied to clipboard

java.lang.RuntimeException: Using WebView from more than one process at once

Open ryandt opened this issue 4 years ago • 3 comments

Hey there. My app's bug reporting tool is reporting several crashes around the use of WebView in LocalizationApplicationDelegate.

Unable to create application [application.name]: java.lang.RuntimeException: Using WebView from more than one process at once with the same data directory is not supported. https://crbug.com/558377 : Current process [process name] (pid 20098), lock owner [process name] (pid 21177)

I'm unfortunately not sure how to reproduce this crash. My best guess is that my application is trying to instantiate a WebView on startup with the same process name as another instance of my app that is in the process of getting killed.

ryandt avatar Jan 20 '22 01:01 ryandt

I see that the WebView is used in LocalizationApplicationDelegate like this

class LocalizationApplicationDelegate {
    fun onCreate(context: Context) {
        WebView(context).destroy()
    }
    ...
}

An WebView object is created and immediately destroyed created and immediately destroyed. I am sure this is the reason of your problem.

For what a WebView is required to handle localization issues?

oschildt avatar Feb 17 '22 14:02 oschildt

@oschildt That's right. This was most likely added to address this issue. But unfortunately this workaround introduces an issue of its own with multiple processes being active at once.

ryandt avatar Feb 19 '22 01:02 ryandt

Since AndroidX AppCompat has per-app language preferences for backward compatibility. Please migrate this library to AndroidX for more stability, compatibility, and longer support from Google team.

See Migrate to AndroidX guide

Thank you for your support

akexorcist avatar Jun 21 '22 21:06 akexorcist