Closed mahavirvataliya closed 4 years ago
Experiencing the same issue for Galaxy devices on Android 9
Experiencing the same issue for nubia devices on Android 9
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 at com.android.webview.chromium.WebViewChromiumAwInit.startChromiumLocked + 63(WebViewChromiumAwInit.java:63) at com.android.webview.chromium.WebViewChromiumAwInitForP.startChromiumLocked + 3(WebViewChromiumAwInitForP.java:3) at com.android.webview.chromium.WebViewChromiumAwInit$3.run + 3(WebViewChromiumAwInit.java:3) at android.os.Handler.handleCallback + 873(Handler.java:873) at android.os.Handler.dispatchMessage + 99(Handler.java:99) at android.os.Looper.loop + 215(Looper.java:215) at android.app.ActivityThread.main + 7376(ActivityThread.java:7376) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 500(RuntimeInit.java:500) at com.android.internal.os.ZygoteInit.main + 865(ZygoteInit.java:865)
Same issue for Galaxy S10e on Android 9 Same RN version: 0.59.10 Same react-native-webview version: 5.10.0
Android 9 prohibit sharing WebView data directory among multiple processes add below code in your mainApplication file
public void onCreate() {
...
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
String processName = getProcessName(this);
String packageName = this.getPackageName();
if (!packageName.equals(processName)) {
WebView.setDataDirectorySuffix(processName);
}
}
}
private String getProcessName(Context context) {
if (context == null) return null;
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) {
if (processInfo.pid == android.os.Process.myPid()) {
return processInfo.processName;
}
}
return null;
}
Same issue
I'm having the same issue...
I'm having the same issue...
Same issue here on Samsung Galaxy S9+ SM-G965F
same issue..
+1
same
same
Android 9 prohibit sharing WebView data directory among multiple processes add below code in your mainApplication file
public void onCreate() { ... if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { String processName = getProcessName(this); String packageName = this.getPackageName(); if (!packageName.equals(processName)) { WebView.setDataDirectorySuffix(processName); } } } private String getProcessName(Context context) { if (context == null) return null; ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) { if (processInfo.pid == android.os.Process.myPid()) { return processInfo.processName; } } return null; }
API 28 onwards there is a new api to get process name which is more performant. Check [here](https://developer.android.com/reference/android/app/Application.html#getProcessName())
can anyone confirm or deny if @hweister 's suggestion works?
Seeing this issue in our production application in crashlytics, but I'm unable to get my hands on any devices where its happening. It seems to be happening only on certain new Samsung devices on android 9 and 10. Samsung Galaxy Note10+, S10+, S10, Note9, S9. No reports of it happening on any other devices running android 9 or 10, Nor can I reproduce on any device i have available.
edit: To my knowledge, we are not using multiple processes in the application? It seems odd to me that we would only see it on Samsung.
relevant packages including all libraries that reference importing from android.webkit:
react-native: 0.59.10,
wix/react-native-navigation, // [v1] of the library
react-native-webview,
react-native-device-info,
react-native-fs,
react-native-image-picker,
Same bug on OnePlus 7 Pro - Android 10.
Unfortunately the suggestion of @hweister did not work.
Same bug on Oppo device too...
And yes the suggestion of @hweister did not work for me as well.
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
This issue still happening, can we reopen it?
Having the same problem with android 10
Having the same problem.
We can refer from this: https://bugs.chromium.org/p/chromium/issues/detail?id=558377#c126
Is this a WebView bug?
Experiencing the same issue for xiaomi Max devices on Android 10 Question details: Main thread Background process
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.dunatv.photosafe (pid 10634), lock owner com.dunatv.foregroundservice (pid 10308)
at org.chromium.android_webview.AwDataDirLock.b(AwDataDirLock.java:28)
at hv.i(hv.java:31)
at gv.run(gv.java:2)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Android 9 Honor 9i
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.dunatv.photosafe (pid 10634), lock owner com.dunatv.foregroundservice (pid 10308) at org.chromium.android_webview.AwDataDirLock.b(AwDataDirLock.java:28) at hv.i(hv.java:31) at gv.run(gv.java:2) at android.os.Handler.handleCallback(Handler.java:907) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Android 9 Honor 9i
Have the exact same issue, while using react but no WebView explicitly
can anyone confirm or deny if @hweister 's suggestion works?
Seeing this issue in our production application in crashlytics, but I'm unable to get my hands on any devices where its happening. It seems to be happening only on certain new Samsung devices on android 9 and 10. Samsung Galaxy Note10+, S10+, S10, Note9, S9. No reports of it happening on any other devices running android 9 or 10, Nor can I reproduce on any device i have available.
edit: To my knowledge, we are not using multiple processes in the application? It seems odd to me that we would only see it on Samsung.
relevant packages including all libraries that reference importing from android.webkit:
react-native: 0.59.10, wix/react-native-navigation, // [v1] of the library react-native-webview, react-native-device-info, react-native-fs, react-native-image-picker,
Did you find anything useful? I'm facing the same issue on Samsung... We are not using multiple processes either, so I don't think 'setDataDirectorySuffix' is a good way to solve it.
Having the same problem.
Anyone got the solution ??
java.lang.RuntimeException: Using WebView from more than one process at once with the same data directory is not supported. https://crbug.com/558377 at org.chromium.androidwebview.AwBrowserProcess.a(PG:40) at ku.c(PG:90) at ky.run(PG:3) at org.chromium.base.task.TaskRunnerImpl.d(PG:50) at EQ.run(Unknown Source:2) at android.os.Handler.handleCallback(Handler.java:907) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Android 10,level 29 HuaWei/EMOTION
Having the same problem
I had encountered the same issue in my previous work, where the app runs on a Cordova derivative. My solution was very similar to @hweister except that:
The crashes mostly stopped after releasing this necessary hack.
Any solution to this? Encountered the same issue on Samsung devices
you can show this link to get more details https://blog.katastros.com/a?ID=01600-3fade614-39a4-4b34-bd09-da94047b1e0d
Android 9 prohibit sharing WebView data directory among multiple processes add below code in your mainApplication file
public void onCreate() { ... if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { String processName = getProcessName(this); String packageName = this.getPackageName(); if (!packageName.equals(processName)) { WebView.setDataDirectorySuffix(processName); } } } private String getProcessName(Context context) { if (context == null) return null; ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) { if (processInfo.pid == android.os.Process.myPid()) { return processInfo.processName; } } return null; }
This worked for me, but i had to make sure it was the first thing called in onCreate, once i moved it around in the method it worked fine. Thanks
Hi, I am facing with the same issue. If you have a proper work around could you provide us a snippet in your documentation ? Thanks
I am also facing the same error
Having same error still
Same here. This error started happenning after adding react-native-background-geolocation
.
P. S. Solution provided by @hweister solved the problem. Thank you very much, I apologize for reopening the issue.
Same issue today when using
"react-native-webview": "^11.23.1",
"react-native": "0.68.2",
Maybe this is relevant: https://bugs.chromium.org/p/chromium/issues/detail?id=558377
This exception was thrown within 2 seconds of booting the app, perhaps indicating that a previous run's WebView had not been fully shut down by the OS (e.g. due to idling). According to the link above, this has a 3s grace period in total.
The full exception was
org.chromium.android_webview.AwDataDirLock in b at line 106
org.chromium.android_webview.AwBrowserProcess in j at line 143
com.android.webview.chromium.b1 in d at line 204
com.android.webview.chromium.b1 in b at line 322
com.android.webview.chromium.WebViewChromiumFactoryProvider in n at line 297
com.android.webview.chromium.WebViewChromium in init at line 302
android.webkit.WebView in <init> at line 429
android.webkit.WebView in <init> at line 353
android.webkit.WebView in <init> at line 336
android.webkit.WebView in <init> at line 323
android.webkit.WebView in <init> at line 313
com.reactnativecommunity.webview.RNCWebViewManager$RNCWebView in <init> at line 1529
com.reactnativecommunity.webview.RNCWebViewManager in createRNCWebViewInstance at line 186
com.reactnativecommunity.webview.RNCWebViewManager in createViewInstance at line 192
com.reactnativecommunity.webview.RNCWebViewManager in createViewInstance at line 130
com.facebook.react.uimanager.ViewManager in createViewInstance at line 139
com.facebook.react.uimanager.ViewManager in createView at line 76
com.facebook.react.uimanager.NativeViewHierarchyManager in createView at line 281
com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation in execute at line 194
com.facebook.react.uimanager.UIViewOperationQueue$1 in run at line 909
com.facebook.react.uimanager.UIViewOperationQueue in flushPendingBatches at line 1026
com.facebook.react.uimanager.UIViewOperationQueue in access$2600 at line 47
com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback in doFrameGuarded at line 1086
com.facebook.react.uimanager.GuardedFrameCallback in doFrame at line 29
com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher in doFrame at line 175
com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1 in doFrame at line 85
android.view.Choreographer$CallbackRecord in run at line 997
android.view.Choreographer in doCallbacks at line 797
android.view.Choreographer in doFrame at line 728
android.view.Choreographer$FrameDisplayEventReceiver in run at line 984
android.os.Handler in handleCallback at line 883
android.os.Handler in dispatchMessage at line 100
android.os.Looper in loop at line 237
android.app.ActivityThread in main at line 8016
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 493
com.android.internal.os.ZygoteInit in main at line 1076
The device was a Samsung SM-G988B running android 10.
Still facing this issue again.? Anyone got any fixes on this one.?
No clue what this is but I hate it so much. I want to use my apps.
I am facing the same issue with Android. Device: Huawei Y9 Prime 2019 Android OS: 10
me too, I have same issue on my service
@hweister Would you be so king to rewrite your fix in Kotlin? 😅 I am trying to upgrade an app I am working on to RN 0.73, the Upgrade Helper tells me to convert MainActivity from Java to Kotlin, and this fix of yours is the last missing piece. Thank you in advance.
Bug description: I am getting this error in Android 9 Samsung Galaxy Note10+ devices with following traces
Stack traces
Environment: