DEV Community

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

Collapse
 
darylaranha profile image
Daryl Aranha

I am unable to run android app. When I run yarn android I am getting this error.

FAILURE: Build failed with an exception.

* Where:
Script '<Project Path>/monorepo/node_modules/react-native/react.gradle' line: 34

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > Couldn't determine CLI location. Please set `project.ext.react.cliPath` to the path of the react-native cli.js
Enter fullscreen mode Exit fullscreen mode

How to update project.ext.react.cliPath path?
Can anyone suggest what changes did I miss?

Collapse
 
darylaranha profile image
Daryl Aranha

I found it. Thank you. I needed to add cliPath inside project.ext.react in app/build.gradle

Collapse
 
aeid profile image
Ahmed Eid

how did you do that, could you please add a screenshot or something ?

Thread Thread
 
darylaranha profile image
Daryl Aranha

I apologies for the late response.
Basically what you need to do is go to mobile/android/app/build.gradle and update the file as show below.

...
project.ext.react = [
    ...
    root: "../../../../",
    cliPath: "../../../../node_modules/react-native"
    ...
]
...
Enter fullscreen mode Exit fullscreen mode

If you want to jump right into the code then you can check out my repo, I have updated the setup.