Error: Cannot find symbol `RCTModernEventEmitter`
See original GitHub issueEnvironment
System: OS: macOS 11.6 CPU: (16) x64 Intel® Core™ i9-9980HK CPU @ 2.40GHz Memory: 3.77 GB / 32.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.18.0 - /var/folders/21/5xmhgtlx4bj0gthrmm8tm3zc0000gq/T/yarn–1666283778817-0.44241538565301974/node Yarn: 1.22.19 - /var/folders/21/5xmhgtlx4bj0gthrmm8tm3zc0000gq/T/yarn–1666283778817-0.44241538565301974/yarn npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm Watchman: 2022.09.12.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/eueddemkim-new/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7784292 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 11.0.16.1 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.4 => 0.63.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
My Android build setting is:
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
supportLibVersion = "30.0.0"
My testing device is Pixel 3XL
on Android 12
.
Description
I’m trying to upgrade the library from 4.2.4
to 4.3.2
. It works okay on iOS, but on Android, it returns errors on build:
Error happens on Android build:
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderEvent.java:13: error: cannot find symbol
import com.facebook.react.uimanager.events.RCTModernEventEmitter;
^
symbol: class RCTModernEventEmitter
location: package com.facebook.react.uimanager.events
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderEvent.java:51: error: cannot find symbol
public void dispatchModern(RCTModernEventEmitter rctEventEmitter) {
^
symbol: class RCTModernEventEmitter
location: class ReactSliderEvent
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSlidingCompleteEvent.java:13: error: cannot find symbol
import com.facebook.react.uimanager.events.RCTModernEventEmitter;
^
symbol: class RCTModernEventEmitter
location: package com.facebook.react.uimanager.events
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSlidingCompleteEvent.java:49: error: cannot find symbol
public void dispatchModern(RCTModernEventEmitter rctEventEmitter) {
^
symbol: class RCTModernEventEmitter
location: class ReactSlidingCompleteEvent
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSlidingStartEvent.java:13: error: cannot find symbol
import com.facebook.react.uimanager.events.RCTModernEventEmitter;
^
symbol: class RCTModernEventEmitter
location: package com.facebook.react.uimanager.events
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSlidingStartEvent.java:49: error: cannot find symbol
public void dispatchModern(RCTModernEventEmitter rctEventEmitter) {
^
symbol: class RCTModernEventEmitter
location: class ReactSlidingStartEvent
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderEvent.java:18: error: ReactSliderEvent is not abstract and does not override abstract method dispatch(RCTEventEmitter) in Event
public class ReactSliderEvent extends Event<ReactSliderEvent> {
^
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSliderEvent.java:50: error: method does not override or implement a method from a supertype
@Override
^
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSlidingCompleteEvent.java:18: error: ReactSlidingCompleteEvent is not abstract and does not override abstract method dispatch(RCTEventEmitter) in Event
public class ReactSlidingCompleteEvent extends Event<ReactSlidingCompleteEvent> {
^
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSlidingCompleteEvent.java:48: error: method does not override or implement a method from a supertype
@Override
^
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSlidingStartEvent.java:19: error: ReactSlidingStartEvent is not abstract and does not override abstract method dispatch(RCTEventEmitter) in Event
public class ReactSlidingStartEvent extends Event<ReactSlidingStartEvent> {
^
/Users/eueddemkim-new/Documents/workspace/mahalo/node_modules/@react-native-community/slider/android/src/main/java/com/reactnativecommunity/slider/ReactSlidingStartEvent.java:48: error: method does not override or implement a method from a supertype
@Override
^
Reproducible Demo
Use latest library, install the app on Android 12 device and run.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
This shouldn’t have any side effects if you are not using new architecture, and guessing by your react native version you are not 😄 So changing this is safe.
Build fails for me with v4.3.3 as well. Showing below error for the event files:
ReactSliderEvent.java:18: error: ReactSliderEvent is not abstract and does not override abstract method dispatch(RCTEventEmitter) in Event public class ReactSliderEvent extends Event<ReactSliderEvent> { ^
For now, getting back to v4.3.2 without the
RCTModernEventEmitter