The module cannot be Android Library?

That happened to me too after following the Android Studio recommendations to switch "android" to "com.android.library in build.gradle.

So for the app module of my project, I just reverted this:

apply plugin: 'com.android.library'

Into this:

apply plugin: 'com.android.application'

GO to "Project structure" icon (it is enlisting where your new,save project icons are showing) then click Module and select Android option and Uncheck Library Module or

PROJECT STRUCTURE->MODULE->ANDROID->UNCHECK LIBRARY