Cannot find entry file index.js with Expo XDE

强颜欢笑 提交于 2019-12-12 16:05:16

问题


When I load my react-native app in Expo I get the error: "Cannot find entry file index.js in any of the roots."

I am adding onto an existing React Web App, and have index.ios.js at the root level. Everything works fine locally, in simulator and through Xcode on my phone hardwired. I've converted my app with exp convert and integrated all info into exp.json.

All info for the ios app is contained in a folder called "ios".

Has anyone run into this or have any thoughts on how to get unstuck?


回答1:


check you package.json and rename index.js to your entry file.

//...
},
  "main": "index.js"
}



回答2:


If you are using Expo, you need to go to your project folder and find the below file:

\node_modules\expo\AppEntry.js

import { KeepAwake, registerRootComponent } from 'expo';
import App from '../../App';

if (__DEV__) {
  KeepAwake.activate();
}

registerRootComponent(App);

and here just replace the App to Custom_Component_Name in the second line of import.



来源:https://stackoverflow.com/questions/44037361/cannot-find-entry-file-index-js-with-expo-xde

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!