How to set the root file to run in react native project.


I created the react native project with react-native init projectname.
When I create the project with this command, it creates the project for me with android/IOS folder.
Now, when I run with react-native run-android
It fires the below error

Solved: Unable to load script from assets ‘’.

I’ll search for this solution, I get that
1.Create the assets folder at here android\app\src\main\

2.Run the below command
react-native bundle --platform android --dev false --entry-file index.js --bundle-output andr
oid/app/src/main/assets/ --assets-dest android/app/src/main/res

By doing these 2 steps, the project creates the file at this path android\app\src\main\assets\

Now, I run the project with react-native run-android, it works fine displaying the Welcome screen
But I can’t get the solution of how to set the root file just like we have App.js when creating the project with expo init projectname.
I want to set the root.js from there I can set the navigationStack of the screens included in a project.


Hey @renishp,

Just for clarification, are you using Expo at all in this project?




For testing, i’m using the expo application
And for project creation, I’m using react-native init projectname.