2

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:

  • OS: Mac
  • OS version: 12.5
  • react-native version: 0.70.5
  • react-native-webview version: 11.23.1
  • Expo CLI Version: 0.4.11
  • EAS CLI Version: 3.2.1
  • Node Version: 14.21.0
  • Yarn Version: 1.22.19

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')

2 Answers 2

0

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

[email protected]

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
0

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!! 🎉

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.