I've been trying to get ActionBarSherlock to work and having some issue. One issue I've come across is the following message when trying to build it:
Plugin with id 'android-library' not found
Specifically:
D:\Projects\Android\actionbarsherlock>D:\Projects\Android\gradlew --info build
Starting Build
Settings evaluated using empty settings script.
Projects loaded. Root project using build file
'D:\Projects\Android\actionbarsherlock\build.gradle'.
Included projects: [root project 'actionbarsherlock']
Evaluating root project 'actionbarsherlock' using build file
'D:\Projects\Android\actionbarsherlock\build.gradle'.
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Projects\Android\actionbarsherlock\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating root project 'actionbarsherlock'.
> Plugin with id 'android-library' not found.
I'm treating this as an ABS issue in a seperate thread, so here I'm curious how to address the general issue of:
Plugin with id 'android-library' not found
Here is the build.gradle:
apply plugin: 'android-library'
dependencies {
compile 'com.android.support:support-v4:18.0.+'
}
android {
compileSdkVersion 14
buildToolsVersion '17.0.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
Can you help?
Add the below to the
build.gradle
project module:// Top-level build file where you can add configuration options common to all sub-projects/modules.
Just for the record (took me quite a while) before Grzegorzs answer worked for me I had to install "android support repository" through the SDK Manager!
Install it and add the following code above apply plugin: 'android-library' in the build.gradle of actionbarsherlock folder!
In later versions, the plugin has changed name to:
And as already mentioned by some of the other answers, you need the gradle tools in order to use it. Using 3.0.1, you have to use the google repo, not mavenCentral or jcenter:
Use
mavenCentral()
orjcenter()
adding in thebuild.gradle
file the script:Instruct Gradle to download Android plugin from Maven Central repository.
You do it by pasting the following code at the beginning of the Gradle build file:
Replace version string
1.0.+
with the latest version. Released versions of Gradle plugin can be found in official Maven Repository or on MVNRepository artifact search.Use
to convert an app module to a library module. More info here: https://developer.android.com/studio/projects/android-library.html