1

I have a ios react native app and I would like to add the android part to it.

I do not understand this line in the docs

Update the react-native dependency in your package.json file to the latest version

Currently my package.json file looks like this

{
  "name": "sassi",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "react-native start"
  },
  "dependencies": {
    "react-native": "^0.15.0",
    "react-native-icons": "^0.7.0",
    "react-native-splashscreen": "^1.0.0"
  }
}

Any help would be greatly appreciated

2 Answers 2

3

the best way is

in console write npm outdated this command show you the latest version that you need update and you need modified your current version in your package.json with latest version and save

after write in console npm update --save

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

Comments

0

The "react-native dependency" is the part which indicates the react-native version you're working with.

In your case it's 0.15.0: "react-native": "^0.15.0".

The latest version of react native at the moment is 0.18, so according to the recommendation that you've mentioned, you should change the version to: "react-native": "^0.18.0".

You'll then need to run npm update to update the package.

3 Comments

After U run the android I get the following error To run your app on Android: Have an Android emulator running (quickest way to get started), or a device connected cd /Users/adamkatz/Projects/react-native/sassi react-native run-android New android projects run fine
I don't know why you are getting this error. But maybe you should just create a new project using "react-native init" and just move your files there?
I restarted my computer and now it magically works, no idea why but I will accept it

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.