Android – the entry file index.js is not found in any root directory: […] (react native)
•
Android
I'm trying to build an APK for my first react native application, but I always get an error from gradle that it can't find index.js. However, I can use this application to find the Expo
Even if I create a new application (using the official template) and try to build it, I get an error:
create-react-native-app foo
cd foo
react-native eject
cd android
./gradlew assembleRelease
Note that after creating the application, you must add the name and displayName attributes to app.json
Executing these orders will still bring me this mistake. What did I do wrong?
resolvent:
I suggest another way to create a new react native application:
1. intall react-native.
2. react-native init <project_name>.
3. cd <project_name>.
4. `react-native start`.(do not close it).
5. (Open another window in terminal run this command) `react-native run-android`.
I hope this method can help you
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码