How do I add a library (android-support-v7-appcompat) in IntelliJ IDEA
Solution 1:
Using Gradle
If you are using Gradle, you can add it as a compile
dependency.
Instructions
-
Make sure you have the
Android Support Repository
SDK package installed. Android Studio automatically recognizes this repository during the build process (not sure about plain IntelliJ). -
Add the dependency to
{project}/build.gradle
dependencies { compile 'com.android.support:appcompat-v7:+' }
-
Click the
Sync Project with Gradle Files
button.
EDIT: Looks like these same instructions are on the documentation under Adding libraries with resources -> Using Android Studio
.
Solution 2:
Without Gradle (Click here for the Gradle solution)
Create a support library project.
Import your library project to Intellij from Eclipse project (this step only applies if you created your library in Eclipse).
Right click on module and choose Open Module Settings.
Setup libraries of v7 jar file
Setup library module of v7
Setup app module dependency of v7 library module