react-native-restart icon indicating copy to clipboard operation
react-native-restart copied to clipboard

app crash on press Restart

Open ferasabufares opened this issue 2 years ago • 4 comments

can you help me please my app crash without any error after run RNRestart.Restart()

platform :Android

     await AsyncStorage.removeItem('user_id');
     await AsyncStorage.removeItem('access_token');
           setTimeout(() => {
            RNRestart.Restart();
           }, 500);
   "@ilterugur/react-native-deck-swiper-renewed": "^2.1.7",
    "@invertase/react-native-apple-authentication": "^2.1.5",
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-async-storage/async-storage": "^1.16.1",
    "@react-native-community/blur": "^3.6.0",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^8.0.0",
    "@react-native-community/push-notification-ios": "^1.10.1",
    "@react-native-community/slider": "^4.2.0",
    "@react-native-firebase/analytics": "^14.4.0",
    "@react-native-firebase/app": "^14.4.0",
    "@react-native-firebase/database": "^14.7.0",
    "@react-native-firebase/dynamic-links": "^14.4.0",
    "@react-native-firebase/in-app-messaging": "^14.7.0",
    "@react-native-firebase/messaging": "^14.4.0",
    "@react-native-google-signin/google-signin": "^7.0.4",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/stack": "^6.1.1",
    "@trava/react-native-drax": "^0.9.8",
    "@yz1311/react-native-intent-launcher": "^0.3.3",
    "appcenter": "4.4.3",
    "appcenter-analytics": "4.4.3",
    "appcenter-crashes": "4.4.3",
    "moment": "^2.29.1",
    "native-base": "^3.3.6",
    "react": "17.0.1",
    "react-native": "0.64.1",
    "react-native-animatable": "^1.3.3",
    "react-native-app-intro-slider": "^4.0.4",
    "react-native-audio-recorder-player": "^3.3.4",
    "react-native-awesome-alerts": "^1.5.2",
    "react-native-camera": "^4.2.1",
    "react-native-card-stack-swiper": "^1.2.5",
    "react-native-code-push": "^7.0.4",
    "react-native-confirmation-code-field": "^7.3.0",
    "react-native-countdown-component": "^2.7.1",
    "react-native-date-picker": "^4.1.5",
    "react-native-detect-navbar-android": "^0.3.0",
    "react-native-device-info": "^8.4.9",
    "react-native-drax": "^0.9.3",
    "react-native-fast-image": "^8.5.11",
    "react-native-fbsdk-next": "^4.6.0",
    "react-native-fs": "^2.18.0",
    "react-native-geocoding": "^0.5.0",
    "react-native-geolocation-service": "^5.3.0-beta.4",
    "react-native-gesture-handler": "^2.3.1",
    "react-native-gifted-chat": "^0.16.3",
    "react-native-google-maps-directions": "^2.1.1",
    "react-native-google-places-autocomplete": "^2.4.1",
    "react-native-image-picker": "^4.7.3",
    "react-native-image-zoom-viewer": "^3.0.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-maps": "^0.30.1",
    "react-native-permissions": "^3.3.1",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "^2.4.1",
    "react-native-render-html": "^6.3.4",
    "react-native-restart": "0.0.24",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-screens": "~3.10.2",
    "react-native-sectioned-multi-select": "^0.9.1",
    "react-native-skeleton-content-nonexpo": "^1.0.13",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-svg": "^12.1.1",
    "react-native-vector-icons": "^9.1.0",
    "react-native-video": "^5.2.0",
    "react-native-view-shot": "^3.1.2",
    "react-native-webview": "^11.17.2",
    "react-redux": "^7.2.6",
    "redux": "^4.1.2",
    "rn-fetch-blob": "^0.12.0",
    "rn-swipe-button": "^1.3.6"

ferasabufares avatar May 11 '22 07:05 ferasabufares

Same problem in iOS too.

haresh4d avatar May 13 '22 02:05 haresh4d

This is an android specific issue I've made a PR.

HammzaHM avatar Jun 13 '22 08:06 HammzaHM

Any plans to release that soon?

Nikola-Andreev avatar Jun 20 '22 08:06 Nikola-Andreev

Yeah, will be much appreciated if that PR gets merged and released.

ptfly avatar Aug 26 '22 12:08 ptfly

Merged. Please report if it comes back.

avishayil avatar Jan 28 '23 19:01 avishayil

Still crash app on emulator pixel 2 API 31, React Native 0.71.1

import RNRestart from 'react-native-restart'; <View> <Text>Something happened!</Text> {/* <Text>{props.error.toString()}</Text> */} <Button onPress={() => RNRestart.restart()}>click</Button> </View>

logcat: ControlsListingControllerImpl: Subscribing callback, service count: 0 04-05 17:29:11.898 687 924 D ControlsListingControllerImpl: Unsubscribing callback 04-05 17:29:11.907 8572 8572 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10146; state: ENABLED 04-05 17:29:11.960 8572 8572 V GraphicsEnvironment: ANGLE Developer option for 'app.xxx.mobile' set to: 'default' 04-05 17:29:11.960 8572 8572 V GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported. 04-05 17:29:11.965 8572 8572 D NetworkSecurityConfig: No Network Security Config specified, using platform default 04-05 17:29:11.967 8572 8572 D NetworkSecurityConfig: No Network Security Config specified, using platform default 04-05 17:29:11.992 8572 8572 I WebViewFactory: Loading com.google.android.webview version 91.0.4472.114 (code 447211484) 04-05 17:29:12.074 8572 8572 W .mobile:phoeni: Accessing hidden method Landroid/os/Trace;->isTagEnabled(J)Z (unsupported, reflection, allowed) 04-05 17:29:12.074 8572 8572 W .mobile:phoeni: Accessing hidden method Landroid/os/Trace;->traceBegin(JLjava/lang/String;)V (unsupported, reflection, allowed) 04-05 17:29:12.074 8572 8572 W .mobile:phoeni: Accessing hidden method Landroid/os/Trace;->traceEnd(J)V (unsupported, reflection, allowed) 04-05 17:29:12.074 8572 8572 W .mobile:phoeni: Accessing hidden method Landroid/os/Trace;->asyncTraceBegin(JLjava/lang/String;I)V (unsupported, reflection, allowed) 04-05 17:29:12.074 8572 8572 W .mobile:phoeni: Accessing hidden method Landroid/os/Trace;->asyncTraceEnd(JLjava/lang/String;I)V (unsupported, reflection, allowed) 04-05 17:29:12.101 8572 8572 I cr_LibraryLoader: Loaded native library version number "91.0.4472.114" 04-05 17:29:12.102 8572 8572 I cr_CachingUmaRecorder: Flushed 6 samples from 6 histograms. 04-05 17:29:12.912 339 339 E [email protected]: Failed to getEnergyData 04-05 17:29:13.633 8572 8572 D AndroidRuntime: Shutting down VM 04-05 17:29:13.640 8572 8572 E AndroidRuntime: FATAL EXCEPTION: main 04-05 17:29:13.640 8572 8572 E AndroidRuntime: Process: app.xxx.mobile:phoenix, PID: 8572 04-05 17:29:13.640 8572 8572 E AndroidRuntime: java.lang.RuntimeException: Unable to create application app.xxx.mobile.MainApplication: 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 app.xxx.mobile:phoenix (pid 8572), lock owner app.xxx.mobile (pid 8379) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6730) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at android.app.ActivityThread.access$1500(ActivityThread.java:247) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7839) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: Caused by: 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 app.xxx.mobile:phoenix (pid 8572), lock owner app.xxx.mobile (pid 8379) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at org.chromium.android_webview.AwDataDirLock.b(chromium-TrichromeWebViewGoogle6432.apk-stable-447211484:27) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at Xu0.i(chromium-TrichromeWebViewGoogle6432.apk-stable-447211484:34) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at Xu0.b(chromium-TrichromeWebViewGoogle6432.apk-stable-447211484:18) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at Xu0.g(chromium-TrichromeWebViewGoogle6432.apk-stable-447211484:3) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at com.android.webview.chromium.WebViewChromiumFactoryProvider.getStatics(chromium-TrichromeWebViewGoogle6432.apk-stable-447211484:4) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at android.webkit.WebView.setWebContentsDebuggingEnabled(WebView.java:2009) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at app.xxx.mobile.MainApplication.onCreate(MainApplication.java:56) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1211) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6725) 04-05 17:29:13.640 8572 8572 E AndroidRuntime: ... 9 more 04-05 17:29:13.652 519 8597 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2 04-05 17:29:13.656 519 1374 W ActivityTaskManager: Force finishing activity app.xxx.mobile/com.jakewharton.processphoenix.ProcessPhoenix 04-05 17:29:13.669 330 385 D goldfish-address-space: claimShared: Ask to claim region [0x1f7890000 0x1f7da0000] 04-05 17:29:13.790 519 1374 W ActivityTaskManager: Force finishing activity app.xxx.mobile/.MainActivity

nguyenduythuc avatar Apr 05 '23 10:04 nguyenduythuc

Hi, I'm experiencing the same issue. I'm using 0.72.0-RC.5. It works fine with 0.0.24, but using 0.0.27 the app crashes when calling RNRestart.Restart() with the following exception:

--------- beginning of crash
06-08 12:30:08.329 17586 17586 E AndroidRuntime: FATAL EXCEPTION: main
06-08 12:30:08.329 17586 17586 E AndroidRuntime: Process: com.appname.dev:phoenix, PID: 17586
06-08 12:30:08.329 17586 17586 E AndroidRuntime: java.lang.RuntimeException: Unable to create application com.appname.MainApplication: 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.appname.dev:phoenix (pid 17586), lock owner com.appname.dev (pid 17346)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6996)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2235)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:205)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:294)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:8170)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: Caused by: 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.appname.dev:phoenix (pid 17586), lock owner com.appname.dev (pid 17346)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at org.chromium.android_webview.AwDataDirLock.b(chromium-TrichromeWebViewGoogle.apk-stable-567252433:187)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at org.chromium.android_webview.AwBrowserProcess.k(chromium-TrichromeWebViewGoogle.apk-stable-567252433:15)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at com.android.webview.chromium.M.d(chromium-TrichromeWebViewGoogle.apk-stable-567252433:180)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at com.android.webview.chromium.M.b(chromium-TrichromeWebViewGoogle.apk-stable-567252433:173)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at com.android.webview.chromium.WebViewChromiumFactoryProvider.getStatics(chromium-TrichromeWebViewGoogle.apk-stable-567252433:16)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at android.webkit.WebView.setWebContentsDebuggingEnabled(WebView.java:2020)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at com.appname.MainApplication.onCreate(MainApplication.java:72)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6991)
06-08 12:30:08.329 17586 17586 E AndroidRuntime: 	... 9 more

yberstad avatar Jun 08 '23 10:06 yberstad

Any update on this? I'm facing the same issue.

FATAL EXCEPTION: main

Caused by: 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.myapp:phoenix (pid 10330), lock owner com.myapp (pid 9078)

jensdev avatar Jun 09 '23 08:06 jensdev