3

I am trying to start my hello world app using react native using windows 7 and an android device. There is a similar issue here but I have failed make it work.

Commands I have run so far to set up and lead to this issue.

  1. Created the app: react-native init helloMe
  2. Moved to the root Dir[helloMe]. react-native run-android
  3. Android Device is set up okay and showing in CMD using adb
  4. Opened another CMD window then ran: react-native start
  5. Ran react-native run-android again.
  6. Red Screen is shown on phone with this error unable to load script from assets index.android.bundle on windows
  7. Trying to fix it with the solution in step 6 leads to another error which is why I am here. below is my CMD log.

    E:\testdir\react_ws\helloMe>react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
    Scanning 558 folders for symlinks in E:\testdir\react_ws\helloMe\node_modules (30ms)
    Scanning 558 folders for symlinks in E:\testdir\react_ws\helloMe\node_modules (20ms)
    Loading dependency graph, done.
    Cannot find entry file index.android.js in any of the roots: ["E:\\testdir\\react_ws\\helloMe"]
    E:\testdir\react_ws\helloMe>
    

Now I am getting another error when I try to fix the problem with the above solution.

Cannot find entry file index.android.js in any of the roots: ["E:\\testdir
\\react_ws\\helloMe"]

If have tried to apply this fix from here

npm run start -- --root <directory_with_your_react_component_js_sources>

I since I am running the command in the project root, I ran this instead npm run start -- --root ./ but it did not work.

This is my root project structure

__tests__  app.json          index.ios.js  node_modules  yarn.lock
android    index.android.js  ios           package.json

I hope I am clear, any help would be highly appreciated. Device is stuck on red screen with a 404.

React-native-version

react-native-cli: 2.0.1
react-native: 0.46.0

Thanks. Requested Project root Structure Snapshot

CMDNPM StartSceenshot 2

8
  • share your react native project skeleton Commented Jul 6, 2017 at 10:10
  • Hi, Do you want a screenshot? cos I have not changed anything from the basic app Commented Jul 6, 2017 at 10:13
  • tests_ app.json index.ios.js node_modules yarn.lock android index.android.js ios package.jso Commented Jul 6, 2017 at 10:14
  • Yes i need screenshot Commented Jul 6, 2017 at 10:14
  • I have added the Image Commented Jul 6, 2017 at 10:20

2 Answers 2

2

Changed the version of react project to a lower one from here

npm install -g rninit

rninit init [Project Name] --source [email protected]

Worked okay for both on both iOS and Android on . If you get Error Could not get BatchedBridge. run this

adb reverse tcp:8081 tcp:8081

This worked for me.

Sign up to request clarification or add additional context in comments.

Comments

0

1: In cmd With This Command ipconfig Find Your ip
And put that in Dev Sttings => Debug server host& port for device

2: turn on your Device wifi

a

And

b

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.