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


#1

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 ‘index.android.bundle’.

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/index.android.bundle --assets-dest android/app/src/main/res

By doing these 2 steps, the project creates the index.android.bundle 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.


#2

Hey @renishp,

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

Cheers,

Adam


#3

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