DEV Community

Discussion on: Tutorial: How to share code between iOS, Android & Web using React Native, react-native-web and monorepo

Collapse
 
brunolemos profile image
Bruno Lemos

There is a "Run" green button inside Android Studio that will open the app inside an emulator.

Collapse
 
bantinggamer profile image
bantingGamer

Thank you so much. I just wanted to make sure that im not missing anything because I couldn't get "react-native run-android" to work.

Thread Thread
 
scesbron profile image
Sebastien Cesbron

You have several options to make react-native commands work.

  • in the node_modules directory of your package make a symlink to the node_modules/react-native directory from the root of the project because react-native-cli need to find cli.js in node_modules/react-native.
  • prefix your command with yarn or npm : yarn react-native run-android
  • in your package.json file add a script "run-android": "react-native run-android" and then use yarn run-android
Thread Thread
 
aminlatifi profile image
Amin Latifi

I used second option. However, I am using third party libraries and it cannot resolve these dependencies!

Could not resolve project :react-native-navigation.
Required by:
project :app
> Unable to find a matching configuration of project :react-native-navigation: None of the consumable configurations have attributes.
Could not resolve project :react-native-vector-icons.
Required by:
project :app
> Unable to find a matching configuration of project :react-native-vector-icons: None of the consumable configurations have attributes.

Thread Thread
 
aminlatifi profile image
Amin Latifi

Solved,
I changed projectDir attribute of library in android/settings.gradle