Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

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

Open
ryandt opened this issue Jan 20, 2022 · 3 comments
Open

Comments

@ryandt
Copy link

ryandt commented Jan 20, 2022

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.

@oschildt
Copy link

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?

@ryandt
Copy link
Author

ryandt commented Feb 19, 2022

@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.

@akexorcist
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants