Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native iOS and Android folders not present

I'm new to react native, and I've been having some trouble understanding the folder structure of the app which should supposedly be present in the project folder on creation. Basically, when creating the project with npm, I get some starting files (App.js etc.) and a node_modules folder. I've got it up and running with expo, which created the .expo folder as well.

However, when I go to react's official documentation or look into plugins/addons on git they talk several times about an android and an iOS folder in the project root. But they are nowhere to be seen. I then got some hints that I could install and run react-native-upgrade-git, which allegedly would generate these missing folders. But that didn't work either.

So what have I missed? Where are those folders located?

Edit: Here is a screen dump from a Youtube tutorial showing the project structure I'm looking for:

enter image description here

like image 493
Simon Eliasson Avatar asked May 30 '17 19:05

Simon Eliasson


People also ask

Can React Native run on both iOS and Android?

With React Native, developers can write real, natively rendering mobile applications for iOS and Android. It helps build apps on two platforms at once, while maintaining the look, feel, and productivity of an app built on the specific iOS or Android platform.

How can I regenerate iOS folder in React Native project?

How can I regenerate ios folder in React Native project? error Unrecognized command "eject". info Run "react-native --help" to see a list of all available commands. You can init a new project that's named the same in another folder and copy ios dir over: Make sure you have clean git history before doing so, in case you need to revert

Is it possible to use expokit with React Native?

One of the points of Expo on top of React Native is that you don't go down to android or ios code. Expo deals with those folders for you, you don't need to interact with them. Is there a reason you need those folders? if so, you will have to eject. Here's the documentation to do so: Ejecting with ExpoKit

How to install React Native on Android using minimal?

in the begining install react native, after run expo init YourProject , choose minimal (Typescript) . after that go to YourProject directory and do not run npm start. but run npm run android. hope this help Welcome to SO! Please fix the formatting to make your answer better readable! See stackoverflow.com/help/how-to-answer

How to create a native app in Android?

1) Take your app name from your current app.json, let's say the name is "mynativeapp" 2) make a new folder somewhere outside of your current project folder 4) the command above will make android and ios folders internally compatible by name with your project Now you can try to start your native project. I checked that for Android: enjoy!


3 Answers

One of the points of Expo on top of React Native is that you don't go down to android or ios code. Expo deals with those folders for you, you don't need to interact with them. Is there a reason you need those folders? if so, you will have to eject. Here's the documentation to do so: Ejecting with ExpoKit

like image 198
Funk Soul Ninja Avatar answered Oct 17 '22 22:10

Funk Soul Ninja


You can get to that project structure by running:

npm run eject

However, it removes the app from the Expo framework, which adds a lot of nice benefits and abstraction from the Android/iOS code.

like image 32
Danny Sullivan Avatar answered Oct 17 '22 20:10

Danny Sullivan


i think if you want to develop app with ReactNative you start follow this : Getting Started use React Native.

If you create project with ReactNative just write on your terminal like:

react-native init YourProjectName
cd YourProjectName
react-native run-ios //for iOS

I hope my answer helping you to create project with ReactNative. thanks..

like image 18
manggaraaaa Avatar answered Oct 17 '22 22:10

manggaraaaa