How to configure java code to answer my own project on intellij?

React-native organizes its project as follows:

android --build.gradle --settings.gradle ios node_modules index.android.js index.ios.js 

This is a bit messy and requires editing js, java and objective C code, and android studio does not support javascript code completion. So I decided to use IntelliJ.

The problem is that if I open at the root level, IntelliJ cannot start Gradle, it will say Error running build (1): Module 'ReactLearning' is not backed by gradle

However, if I open on ./android in Android Studio or IntelliJ, it works fine, and I see all the external libraries and code completion. But now I can’t edit any code at the root level. I could open 2 editors, one in the root, and the other specifically for Android, but then the IDE constantly overwrites each other's files.

What can I do to tell the IDE / Gradle that the corresponding project is in the same subdirectory?

+18
source share
1 answer

When you create a React Native project, an Android project is created inside its file tree:

enter image description here

Now you can open your Android project using IntelliJ Idea or Android Studio along the following path:

 /path/to/untitled/android 

And an untitled project that was created using react-native init using WebStorm, which has JS support, with a path:

 /path/to/untitled 
0
source

Source: https://habr.com/ru/post/1011968/


All Articles