1

I have basic React Native app. I am trying to test it in virtual Android device. I am navigating to the project and type npm start -- --reset-cache. I kill the proccess and I am typing react-native run-android. I have active Android device, but I see on it this error:

The development server returned response error code: 404 URL: http://10.0.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false Body... "Cannot find entry file index.js in any of the roots:[\"c:\\projects\\HelloRN]"....

I have index.js in the root of the project. Metro Bundler is running on port 8081, but I see same error from it. I am using React Native 0.51.0.

1
  • Does native not use the public/src folder structure? I don't know native - sorry if this is misleading. Commented Dec 18, 2017 at 20:47

2 Answers 2

2

There are two possible solutions:

  1. index.js file isn't in the project root
  2. react-native, in some cases, can't read index.js because try to find index.ios.js and index.android.js, so, duplicate index.js and rename to index.android and index.ios.js
Sign up to request clarification or add additional context in comments.

Comments

0

The problem was with permissions. When I create same project in another partition, but not in the C: partition, where Windows is installed, it works fine and it founds index.js file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.