jdpagley
jdpagley

Reputation: 21

React-native-webview RNCWebView.isFileUploadSupported Error on Expo EAS Android Build SDK 47

Bug description:

The Expo Supported version of this package 11.23.1 is throwing an error and not moving past the splash screen. This started happening after upgrading from Expo SDK 45 to Expo SDK 47. on EAS Android Build.

This module works just fine in Expo Go but when I load my app in the actual Android build I get the error below:

TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNCWebView.isFileUploadSupported')

To Reproduce:

Step 1: Run npx create-expo-app my-app and cd my-app (sdk 47) Step 2: Install react-native-webview npx expo install react-native-webview. Yarn is used as the package manager. Step 2: Add WebView like the example below to the main App.js file:

import * as React from 'react';
import { WebView } from 'react-native-webview';

export default function App() {
  return (
    <WebView
      style={{width: 100, height: 100}}
      source={{ uri: 'https://expo.dev' }}
    />
  );
}

Step 3: Create EAS Android (I recommend using the following in your EAS profile: { "developmentClient": true, "distribution": "internal" }. This will make it easier to see the error message.)

Step 4: (If using developmentClient build) Start expo locally npx expo start and open in Android Build. (NOTE: react-native-webview works fine in Expo Go, it only throws the error when loading it in an actual build.)

Expected behavior:

App should load past the splash screen.

Screenshots/Videos:

The following error happened after loading my app in the Android Build

Environment:

I tried to use react-native-webview inside of an Expo EAS Android Build using Expo SDK 47. I expected for the app to load just fine like the previous version of my app built with Expo SDK 45 and Expo Build:Android. Currently it's not moving past the splash screen and is throwing the following error:

TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNCWebView.isFileUploadSupported')

Upvotes: 2

Views: 884

Answers (2)

jdpagley
jdpagley

Reputation: 21

I worked with other developers using the same Expo version and build process and react-native-webview worked for them. This made me think that maybe it had something to do with my environment and not the module.

This caused me to look into what version of node, npx, yarn, etc. I moved to Node v18+ (I was previously on Node 14) and that upgraded me to NPX v8.19.2. After that I went through the same steps to reproduce the problem it worked!! 🎉

Upvotes: 0

jjahanzab
jjahanzab

Reputation: 1

use this version of WebView. it is working well for me.

[email protected]

Upvotes: 0

Related Questions