react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

react-native 0.73.2 project getting com.appName.mainActivity can not be cast to com.reactnativenavigation.NavigationActivity

Open Martyneris opened this issue 5 months ago • 10 comments

What happened?

I've installed the latest (7.37.2) version of react-native-navigation in my 0.73.2 react-native project, Android version builds but upon running the project I get the com.appName.mainActivity can not be cast to com.reactnativenavigation.NavigationActivity error. I want to emphasize that with the new 0.73.2 react-native version files I wasn't able to fully follow through with your installation. In react-native 0.73.2 MainActivity.java and MainApplication.java files are replaced with MainActivity.kt and MainApplication.kt respectively and they do not include any of the code that is described in react-native-navigation's installation guide, therefore I didn't know where or what to add.

What was the expected behaviour?

The project runs without any errors

Was it tested on latest react-native-navigation?

  • [X] I have tested this issue on the latest react-native-navigation release and it still reproduces.

Help us reproduce this issue!

No response

In what environment did this happen?

React Native Navigation version: 7.37.2 React Native version: 0.73.2 Has Fabric (React Native's new rendering system) enabled: no Node version: 18.18.0 Device model: Emulator Android version: 14

Martyneris avatar Jan 31 '24 13:01 Martyneris

@Martyneris can you please try the latest version? 7.38.0

asafkorem avatar Feb 18 '24 20:02 asafkorem

Getting the same error 'com.lanch.MainActivity cannot be cast to com.reactnativenavigation.NavigationActivity' in 7.38.3

@asafkorem

aneena-thomas avatar Feb 29 '24 05:02 aneena-thomas

same issue

ombogdanJoinToIt avatar Feb 29 '24 13:02 ombogdanJoinToIt

Switching to .java fixed issues for me

aneena-thomas avatar Feb 29 '24 13:02 aneena-thomas

@aneena-thomas do you have error in ios?

ombogdanJoinToIt avatar Feb 29 '24 13:02 ombogdanJoinToIt

No errors. Keep the old MainActivity.java and MainApplication.java as it is.

aneena-thomas avatar Feb 29 '24 13:02 aneena-thomas

@aneena-thomas I get errors on iOS

ombogdanJoinToIt avatar Feb 29 '24 14:02 ombogdanJoinToIt

What are the errors you got? @ombogdanJoinToIt

aneena-thomas avatar Feb 29 '24 14:02 aneena-thomas

I think this error does not belong to this thread @aneena-thomas Error: Component "myProjectID" does not have a componentId!

This error is located at: in WrappedComponent in RCTView in Unknown in RCTView in Unknown in AppContainer, js engine: hermes

ombogdanJoinToIt avatar Feb 29 '24 14:02 ombogdanJoinToIt