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

Redirect fail on Android #3421

Closed
jdeverdun opened this issue Apr 30, 2024 · 2 comments
Closed

Redirect fail on Android #3421

jdeverdun opened this issue Apr 30, 2024 · 2 comments

Comments

@jdeverdun
Copy link

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

@danielrys
Copy link

Same here, similar setup:

  • webview 13.8.7
  • RN 0.73.6
  • Expo 50.0.17

Initial uri specified in source loads just fine and displays a page, but once the page is redirected after user interaction inside the webview, I also get the exact above message. The same code worked without issues previously on following setup:

  • webview 13.6.4
  • RN 0.72.6
  • Expo 49.0.6

Don't have a solution yet, unfortunately. Downgrading to 13.6.4 while on the newer versions of RN & Expo does not seem to help, so not quite sure if this is actually a webview problem. The RN release notes don't give much clue about any possibly related breaking change.

@jdeverdun
Copy link
Author

jdeverdun commented May 2, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants