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 - Cannot find entry file index.android in any of the roots. #18217

Closed
ghost opened this issue Mar 6, 2018 · 11 comments
Closed

React Native - Cannot find entry file index.android in any of the roots. #18217

ghost opened this issue Mar 6, 2018 · 11 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@ghost
Copy link

ghost commented Mar 6, 2018

I was developing an Android app using React Native. I was trying to use an emulator to run an application using an Android device, and then trying to run it again as an emulator.
Previously, when using Windows, I solved the problem by using "adb reverse tcp:8081 tcp:8081" method, but this method was not solved in the process of developing with mac today. Please help me somebody.

2018-03-06 16 48 39

__

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like your issue may be incomplete. Are all the fields required by the Issue Template filled out?

You may safely ignore this if you believe your issue contains all the relevant information. Thank you for your contributions.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added No Template Ran Commands One of our bots successfully processed a command. labels Mar 6, 2018
@AdrianMrn
Copy link

AdrianMrn commented Mar 6, 2018

Make sure your version of React Native on your Mac is up to date. What do you get when you type react-native -v in your terminal?

Also see: #14246

@hannigand
Copy link

hannigand commented Mar 6, 2018

Getting the same problem on iOS. I haven't tried Android yet.

screen shot 2018-03-06 at 10 13 19

react-native: 0.53.0

Running npm start -- --reset-cache and then react-native run-ios does not fix the problem.

Frustratingly I have to create an index.ios.js and index.android.js and duplicate the contents of index.js until a fix is identified.

@AdrianMrn
Copy link

AdrianMrn commented Mar 6, 2018

In that case, I'm at a loss.

When you're running react-native run-ios[/android], it's looking for an index.ios[/android].js file, which doesn't exist past react-native 0.51 (or earlier, idk). That's why I thought you were running an older version.

I'm sure this is a recurring issue and somebody else will be able to answer your question, sorry I couldn't be of more help.

@hannigand
Copy link

No worries @AdrianMrn, all discussion is welcome. It's very bizarre that it has been working in the past but I've only got this problem this morning.

@ghost
Copy link
Author

ghost commented Mar 7, 2018

@AdrianMrn
my react-native version is
react-native-cli: 2.0.1
react-native: 0.53.3

@AdrianMrn
Copy link

@kojongick @hannigand if you still haven't fixed this, a temporary workaround could be to create 2 files called index.android.js and index.ios.js, and copy+pasting what you have in index.js into these files.

@hramos hramos added the Android label Mar 8, 2018
@react-native-bot
Copy link
Collaborator

This issue was marked as lacking information required by the issue template. There has been no activity on this issue for a while, so I will go ahead and close it.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

If you are the author of this issue and you believe this issue was closed in error (i.e. you have edited your issue to ensure it meets the template requirements), please let us know.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Mar 16, 2018
@alexxsanchezm
Copy link

I know this issue is closed, but to anyother else out must know this happened after a react native upgrade. I'm currently using:

RN: 0.56
RN-CLI: 2.0.1

My guess the server is running with a different version and looking for index.[android/ios].js file. Although if I create a new project, It runs as expected.

@abn0rmal-d0ct0r
Copy link

React Native Cli --> 2.0.1
React Native --> 0.57.2

And I still get the same error. Looks like the only to get out is to create index.android/ios.js file and duplicate the files.

@Navil
Copy link

Navil commented Oct 24, 2018

You can also just create index.android.js in the root directory and add only following line to it: import './index.js';.
That way, you won't have to duplicate the content of your index.js.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 16, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants