Android crash after taking photo via <input type="file"> inside WebView
Bug description:
When HTML is used inside react-native-webview, choosing the camera, capturing a photo, and confirming cause the app to crash and restart on Android (observed on Samsung Tab A SM-T515 RAM 2GB). The crash happens right as control returns from the camera app to the WebView.
To Reproduce:
- Render a WebView that loads an HTML page containing .
- Tap the file input → choose Camera.
- Take a photo and tap OK / confirm.
- The app crashes and restarts instead of returning the selected image to the web page.
Expected behavior:
The WebView returns the captured image to the page and file selection completes without crashing.
Actual behavior:
Immediately after confirming the camera capture, the process is killed and the app restarts.
Logcat:
I ActivityManager: Killing 11681:com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0/u0a260i19 (adj 900): isolated not needed W ActivityManager: wait for provider publish: waiters=1 callerApp=ProcessRecord{3157b2c 9706:com.sec.android.app.camera/u0a75} cpr=ContentProviderRecord{7caad3b u0 com.app/com.reactnativecommunity.webview.RNCWebViewFileProvider} I ActivityManager: Start proc 12039:com.app/u0a260 for content provider {com.app/com.reactnativecommunity.webview.RNCWebViewFileProvider} W ActivityManager: Scheduling restart of crashed service com.samsung.klmsagent/.service.ProtectService in 1000ms for start-requested W ActivityManager: Scheduling restart of crashed service android/com.android.server.DrmEventService in 0ms for persistent E unknown:ReactHost: com.facebook.react.bridge.ReactNoCrashSoftException: ... Tried to access onActivityResult while context is not ready I WebViewFactory: Loading com.google.android.webview version 139.0.7258.94 (code 725809430) I chromium: ... variations_seed_loader.cc:67 Failed to open file for reading.: No such file or directory (2) W unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.reactnativecommunity.webview.RNCWebViewManager
Environment:
- OS version: One Ui 3.1 (Android 11)
- Model - Samsung Tab A SM-T515 (only on RAM 2 GB version)
- react-native version: 0.79.6
- react-native-webview version: 13.15.0
- Android WebView (from logs): 139.0.7258.94
Same issue with ios
+1
Hi @jamonholmgren , Kindly take a look.,
Hi, I had the same issue on
iOS, and it turned out to be a permission problem./* my log */ This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.I solved it by referring to react-native-permissions
Added NSCameraUsageDescription in Info.plist
Updated the Podfile with:
setup_permissions([ ..., 'Camera' ])
After doing this, the crash was resolved.
this is related to permission handling not related to issue.,
+1
+1 We've seen the same issue appear on very few Android devices.