Thursday, September 17, 2015

How to fix "Plugin with id '' not found." issue with Android Libraries

Normal structure of build.gradle for an Android library looks like this:
apply plugin: ''
android {
    compileSdkVersion 23 
    buildToolsVersion '23.0.0'
    defaultConfig {
        minSdkVersion 11 
       targetSdkVersion 23 
       versionCode 1 
       versionName "1.0" 
    buildTypes {
        release {
            /runProguard false 
           proguardFiles getDefaultProguardFile('proguard-android.txt'), ''        }

You might encounter dreaded "Plugin with id '' not found." error while importing this library project as an independent project in Android Studio.

After researching for a while around the web, I figured out what was missing. Actually, a way to tell your library project's gradle file to source to get the plug-in. Pretty straight forward, but may not occur when needed.

So, don't forget to add these lines at the beginning of the build.gradle for your Android library:

buildscript {
    repositories {
    dependencies {
        classpath ''    }

apply plugin: ''



  1. It is showing me a warning that dependencies cannot be applied to groovy.lang.closure