I also had this problem at startup.
The problem is that if any of your modules has a Manifest.xml file, AS will automatically assume that you need aar and all modules, even if they are java modules to follow suit.
To fix this, you will need to create a new project without activity, close the studio. Then go to the directory in which the application runs. Delete the default app folder and update settings.gradle to remove include 'app' .
Reload the project, and AS will know that this project is only java, and when you press F4 to configure the module, you will see that you have the option to add artifacts , one of which is jar.
Others think that keep in mind that if you are developing android only jar (obviously very likely), you will need to go to the libraries tab and add from maven com.google.android:android:{version} so that you can create your own project. Define the provided scope as the one who uses it will provide this dependency.
The most recent version of this post is 4.1.1.4
EDIT:
If you installed the project SDK in the Android option, you will not need to include the android library.
source share