Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raygun RUM process causes RuntimeException #79

Open
Matty3Run opened this issue May 14, 2021 · 4 comments
Open

Raygun RUM process causes RuntimeException #79

Matty3Run opened this issue May 14, 2021 · 4 comments
Labels
Milestone

Comments

@Matty3Run
Copy link

I added Raygun for my app, following the instructions provided by the official documentation.
After roll out to production, I'm receiving numerous crashes in Firebase Crashlytics, caused by the RUM process of Raygun added in the AndroidManifest.

The Stacktrace of the exception is:

Fatal Exception: 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 com.example.package:rumpostservice (pid 1479), lock owner com.example.package (pid 30096)

Obviously, "com.example.package" is not the real package name of the app.

Can anyone help me with this issue?

@TheRealAgentK TheRealAgentK self-assigned this May 14, 2021
@TheRealAgentK
Copy link
Contributor

Hey @Matty3Run, can you provide some additional information how you're using WebView in your app and share some code?

Is it essentially a web-app where the WebView holds all/nearly all of your app? Or do you have individual web views rendering some bits of HTML contents here and there?

There's no obvious way how rumpostservice should be even able to deal with your or any other WebView.

What you could try until I'm able to reproduce this, would be to set a different data directory per process:

https://developer.android.com/reference/android/webkit/WebView.html#setDataDirectorySuffix(java.lang.String)

@Matty3Run
Copy link
Author

Thank you for your answer. Unfortunately, I cannot reproduce the crash in my app for now, but i constantly receive crashes on the Firebase console (20 per day, with 10.000 active users).

I already tried to set WebView.setDataDirectorySuffix for devices with Android >= 9.0 in the Application class, unfortunately it didn't worked, because now i receive a IllegalStateException when i try to set the suffix, saying "Can't set data directory suffix: WebView already initialized".

The app is not a web-app, it's a standard app, with only two screens using a WebView, in the "help" section and in the "payment" section. I tried to reproduce the crash opening the WebView fragments, but nothing happened.

Some details about the Raygun implementation in my app:

  • Raygun version 4.0.1
    implementation 'com.raygun:raygun4android:4.0.1'

  • Raygun setup is on the "OnCreate" method of the SplashActivity (LAUNCHER Activity in AndroidManifest)

private fun setupRaygun() {
    RaygunClient.init(application)

    RaygunClient.enableRUM(this)
}
  • I added those two services in AndroidManifest, following the documentation
<service android:name="com.raygun.raygun4android.services.CrashReportingPostService"
      android:exported="false"
      android:permission="android.permission.BIND_JOB_SERVICE"
      android:process=":crashreportingpostservice"/>

<service android:name="com.raygun.raygun4android.services.RUMPostService"
      android:exported="false"
      android:permission="android.permission.BIND_JOB_SERVICE"
      android:process=":rumpostservice" />
  • Finally, i added the requested meta-data, as stated in the documentation
<meta-data android:name="com.raygun.raygun4android.apikey"
      android:value="@string/raygun_apikey" />

That's all, i didn't use any other feature of Raygun at the moment.
Tell me if you need some more information, and thanks again for the support.

@Matty3Run
Copy link
Author

Hi, are there some news regarding this issue? I still haven't find a solution, so I can't use Raygun in my Android application at the moment.

@TheRealAgentK
Copy link
Contributor

TheRealAgentK commented Aug 23, 2021

I noticed there's been some additional activity in the Chrominum bug tracker for this recently.

https://crbug.com/558377

Interesting are in particular comments 225 and 226.

225 essentially says: try to not run multiple processes when using WebViews and running into this issue.

So what you could try is to change:

<service android:name="com.raygun.raygun4android.services.RUMPostService"
      android:exported="false"
      android:permission="android.permission.BIND_JOB_SERVICE"
      android:process=":rumpostservice" />

to

<service android:name="com.raygun.raygun4android.services.RUMPostService"
      android:exported="false"
      android:permission="android.permission.BIND_JOB_SERVICE" />

and see if that improves the situation.

Note: In #74 I advised a user against doing this specifically for crash reporting, because having the CR service run in its own process has a lot of benefits due to the app process and the VM potentially being shut down because of a crash. That situation is less of a concern for a RUM Post.

The interesting bit in comment 226 is that people have seen the prevalence of this error dropping massively since June and attribute it to Samsung having fixed some problems in the platform. I don't know what the distribution of Android versions and vendor platforms you've seen when encountering the issue, but that's another thing you could try: Is it still even happening to the level of prevalence you've seen before if you put the RUM provider back in.

@TheRealAgentK TheRealAgentK added this to the 5.0 milestone May 2, 2022
@TheRealAgentK TheRealAgentK removed their assignment Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants