To create a libary , you should use File -> New -> New Module -> Android Library. This will create a basic library project.
When that's done, you must have a project that is set up the following manner:
[project root directory]
[library root directory]
[gradle]
build.gradle...