原则上,IntelliJ 尊重构建文件,并将尝试使用它来配置 IDE 项目。反之亦然,IDE 的更改通常不会影响构建文件。
由于大多数 Android 项目都是由 Gradle 开发的,
了解这个工具总是一个好主意。
I'd suggest referring to @skyfishjy's answer, as it seems to be more updated than this one.
下面的内容没有更新
虽然 android 工作室是基于 IntelliJ IDEA,但同时它也依赖 gradle 来构建你的 apk。从0.2.3开始,这两种方法在 GUI 配置方面不能很好地发挥作用。
As a result, in addition to use the GUI to setup dependencies, it will also require you to edit the build.gradle file manually.
You can simply download the library which you want to include and copy it to libs folder of your project. Then select that file (in my case it was android-support-v4 library) right click on it and select "Add as Library"