Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
Martyneris opened this issue Jan 31, 2024 · 9 comments

Comments

@Martyneris
Copy link

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?

  • 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

@asafkorem
Copy link
Collaborator

@Martyneris can you please try the latest version? 7.38.0

@aneena-thomas
Copy link

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

@asafkorem

@ombogdanJoinToIt
Copy link

same issue

@aneena-thomas
Copy link

Switching to .java fixed issues for me

@ombogdanJoinToIt
Copy link

@aneena-thomas do you have error in ios?

@aneena-thomas
Copy link

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

@ombogdanJoinToIt
Copy link

@aneena-thomas I get errors on iOS

@aneena-thomas
Copy link

aneena-thomas commented Feb 29, 2024

What are the errors you got? @ombogdanJoinToIt

@ombogdanJoinToIt
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants