I\'m trying to setup a development environment to do some custom modifications on the AOSP source code, and would like to use Android Studio as my IDE. After doing the necessary
I always use these steps without any problem at all:
https://shuhaowu.com/blog/setting_up_intellij_with_aosp_development.html
The most important parts for your problem are:
In the link you can see screenshots that can make the steps easier to follow.