question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'RCTEventEmitter' is deprecated for RN version >= 0.65

See original GitHub issue

Bug description:

Although this is not a bug per se, react-native-webview is not optimised for RN version >= 0.65

When I build Android I get a bunch of deprecation warnings

w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopHttpErrorEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopHttpErrorEvent.kt: (11, 3): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopHttpErrorEvent.kt: (22, 42): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopHttpErrorEvent.kt: (23, 21): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingErrorEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingErrorEvent.kt: (11, 3): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingErrorEvent.kt: (22, 42): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingErrorEvent.kt: (23, 21): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingFinishEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingFinishEvent.kt: (11, 3): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingFinishEvent.kt: (22, 42): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingFinishEvent.kt: (23, 21): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingProgressEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingProgressEvent.kt: (11, 3): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingProgressEvent.kt: (22, 42): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingProgressEvent.kt: (23, 21): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingStartEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingStartEvent.kt: (11, 3): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingStartEvent.kt: (22, 42): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopLoadingStartEvent.kt: (23, 21): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopMessageEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopMessageEvent.kt: (10, 75): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopMessageEvent.kt: (21, 42): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopMessageEvent.kt: (22, 21): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopRenderProcessGoneEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopRenderProcessGoneEvent.kt: (12, 3): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopRenderProcessGoneEvent.kt: (23, 42): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopRenderProcessGoneEvent.kt: (24, 21): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopShouldStartLoadWithRequestEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopShouldStartLoadWithRequestEvent.kt: (10, 89): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopShouldStartLoadWithRequestEvent.kt: (27, 42): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/events/TopShouldStartLoadWithRequestEvent.kt: (28, 21): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java

To Reproduce: Build a fresh project with the following setup

"react": "17.0.2",
"react-native": "0.65.0-rc.3",
"react-native-webview": "^11.13.0",

Expected behavior: Not to see any deprecation warnings while building the Android app

Screenshots/Videos: See build log above

Environment:

  • OS: Mac
  • OS version: 11.4
  • react-native version: 17.0.2
  • react-native-webview version: 0.65.0-rc.3

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:31
  • Comments:28

github_iconTop GitHub Comments

6reactions
ShankhadeepBanerjeecommented, May 23, 2022

adding this, org.gradle.jvmargs=-Xmx2048m

in gradle.prperties solved the issue for me

3reactions
DjemsJazz23commented, Sep 21, 2022

Same in RN 0.70.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

rcteventemitter deprecated | The AI Search Engine You Control
Although this is not a bug per se, react-native-webview is not optimised for RN version >= 0.65. When I build Android I get...
Read more >
What are the alternatives to RCTEventEmitter and ...
What is the alternative to dispatch and RCTEventEmitter as both are deprecated? I was looking into RCTModernEventEmitter and it also extends ...
Read more >
react-native-webview - npm
React Native WebView component for iOS, Android, macOS, and Windows. Latest version: 11.26.0, last published: 17 days ago.
Read more >
Announcing React Native 0.65
Today we're releasing React Native version 0.65 with a new version of Hermes, improvements to accessibility, package upgrades, and more.
Read more >
@react-native/polyfills | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found