Search code examples
androidandroid-studioandroid-library

How to create Android Studio project with ONLY a library module


I'm having a lot of trouble trying to create an Android Studio project with just a library module in it. If I go to File -> New -> New Project, it assumes that I'm making an app, even if I tell it not to create an empty activity. If I then make a library module, I'll have a useless app module in the project as well.

Is there any way to remove that module? I've tried deleting the directory (which seems to confuse Android Studio) and I've tried deleting it through the Module Settings menu in Android Studio (which causes it to be immediately recreated). There must be a way to do this, right?


Solution

  • For anyone who is having this same problem, it appears that you truly cannot delete the app module from an Android Studio project. All projects must have an app module, even if the main purpose is to create a library. I ended up making a small example app showing how to use the library, which appears to be the convention.