1

i'm trying to use react native with android studio

i've tried import my react native project to android studio

but this error occure

    This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.

like this image

enter image description here

so how can i fix this error?? i've seen the Link but i don't understand.. it is not clear

user15322469
  • 841
  • 1
  • 8
  • 31

2 Answers2

4

Your project doesn't know that you have a build.gradle file.

To solve this problem, you will need to do the following:

  1. Add your settings.gradle file if you don't have one. In the file add: include ':'

  2. Re-import everything in android studio by completing the following steps:

  • Exit out of your project/back it up

  • Delete the .idea folder in the root directory of the project + delete all the .iml files in your project

  • Import your project in Android Studio, and when the dialog asks you to choose a file, select the build.gradle file

CodingChap
  • 1,088
  • 2
  • 10
  • 23
  • If I remove the .idea file, the android option disappears from the project category in Android Studio. – user15322469 Apr 08 '21 at 04:16
  • Hi, before you delete the .idea file, first back it up. Then follow the same process and finally choose to import the `build.gradle` file when you re-enter android studio. – CodingChap Apr 08 '21 at 06:13
0

I went to my project folder in Terminal and ran

open -a /Applications/Android\ Studio.app

and it allowed it to access node and download the Gradle files.

Found the answer from this post: React Native on Android: Cannot run program "node": error=2, No such file or directory

Ian
  • 1,746
  • 1
  • 15
  • 28