Skip to content

Redirect fail on Android #3421

Description

@jdeverdun

Bug description:
Hello everyone, I'm trying to use the WebView in my expo app (even when downgrading react-native-webview version), which works fine on iOS but fail on android with error :

Invariant Violation: Failed to call into JavaScript module method WebViewMessageHandler1.onShouldStartLoadWithRequest(). Module has not been registered as callable. Bridgeless Mode: false. Registered callable JavaScript modules (n = 12): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, HMRClient, AppRegistry, RNCWebViewMessagingModule, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

To Reproduce:
Here is the code which fails on redirect :

import React, { useRef } from 'react';
import { WebView } from 'react-native-webview';
import { View } from 'react-native';

const MyWebView = () => {
    const webViewRef = useRef(null);

    return (
        <View style={{ flex: 1 }}>
            <WebView
                ref={webViewRef}
                source={{ uri: 'https://stackoverflow.com' }}
            />
        </View>
    );
};

export default MyWebView;

Expected behavior:

Environment:

  • OS: Android
  • OS version: API 34
  • react-native version: 0.73.6
  • react-native-webview version: 13.8.7

Anyone facing this issue ?

Thanks for your help

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions