Han Qin . Me

Always being better

Add an Android Library Project in Intellij or Android Studio

It can be tricky sometimes when adding an android library project in intellij or android studio. The reasons may vary from time to time but two I recently encountered are:

  1. Automatic update of project.properties is disabled in intellij, thus the android library project cannot be added.
  2. Creating a new library module in android studio, for an ant based project, Studio only creates a settings.gradle, but forget to change the project.properties.

So far, the root cause is clear, the inconsistency between ide settings and android configs.

  1. You can manually update project.properties to a correct value
1
2
target=android-16
android.library.reference.1=../../actionbarsherlock

and

1
2
android.library=true
target=android-14
  1. Remember to update settings in your IDE

images

That’s it.

Comments