I cannot find index.ios.js and index.android.js in my react native package, instead index.js is present. I am new to this, I tried running all the commands again, created one more project still the same.
3 Answers
I've left react-native since v0.43. Back then, there were index.ios.js
and index.android.js
in standard RN app.
Now I'm back at v0.49 and everything has changed. By creating new project using create-react-native-app, everything I got is just a single App.js
or index.js
file for rendering main component.
This is the new approach, the better practices for creating RN project for beginners to avoid boilerplate code and make it easy to understand from the beginning. When you are more familiar with RN and want to render different components separately for each platform, just create your separate index.ios.js
and index.android.js
files.

- 9,695
- 11
- 48
- 71
-
1now i am getting this error " Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/albums.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist" – Oct 26 '17 at 18:02
-
@abhinavjha error comes right after you create app? I guess you created your app using `react-native init` – nhoxbypass Oct 26 '17 at 18:45
-
@abhinavjha react-native init is old, and if you new to RN please use `create-react-native-app`. You don't have to manual build the project but run it with the help of Expo. The different: https://stackoverflow.com/questions/45782536/whats-the-real-diff-between-create-react-native-app-myproject-and-react-nativ – nhoxbypass Oct 27 '17 at 01:29
The latest setup of react native gives only one file as we need to write the same code for every platform.If you want to write platform specific code then you can use Platform of react-native.The common practice is to create a common folder let's say src where you can put your react native code.I hope it may be helpful to start with react-native.

- 780
- 1
- 8
- 15
-
Can you give me some documents about the changes in this lasted setup of RN? – nhoxbypass Oct 26 '17 at 05:03
-
now i am getting this error " Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/albums.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist" – Oct 26 '17 at 18:03
As mentioned above is not a good practice to duplicate code like it was at the start of the structure of the proyect instead you shared components that you can select which one to render depending on the platform they will be used in.

- 34
- 1
- 5
-
now i am getting this error " Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/albums.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist" – Oct 26 '17 at 18:03