Normal structure of build.gradle for an Android library looks like this:
You might encounter dreaded "Plugin with id 'com.android.library' 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:
apply plugin: 'com.android.library' 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'), 'proguard-rules.pro' } } }
You might encounter dreaded "Plugin with id 'com.android.library' 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 { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' } } apply plugin: 'com.android.library'