Ciro González
Ciro González

Reputation: 367

Library - Plugin with id "com.android.library" not found

I just pulled an old project that its a library. I had to edit this to generate a new aar and include it again in my main project.

When i pulled the project and tried to open it i got that error of the tittle. "ERROR: Plugin with id 'com.android.library' not found."

I have only one gradle (build.gradle) and it is this one.

apply plugin: 'com.android.library'

android {
compileSdkVersion 28

lintOptions {
    abortOnError false
}
defaultConfig {
    minSdkVersion 18
    targetSdkVersion 28
    versionCode 1000000
    versionName "1.0.0"

    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        buildConfigField "String", 'BASE_URL', '"https://d.api.redlink.com.ar/redlink/desarrollo/"'

    }
    debug {
        buildConfigField "String", 'BASE_URL', '"https://d.api.redlink.com.ar/redlink/desarrollo/"'
    }
}

configurations {
    retrofit
}

}

dependencies {
    api fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.12.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

Upvotes: 2

Views: 14915

Answers (3)

João Eudes Lima
João Eudes Lima

Reputation: 895

Check if declaration of custom repos have the properties url as:

maven { url = "https://dl.bintray.com/eduayuso/kolibs" }

Upvotes: 0

Tore
Tore

Reputation: 1264

For me, I needed to specify a classpath as well. So similar to Abhishek, but I added:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.0'
    }
}

And now com.android.library was found

Upvotes: 2

Abhishek
Abhishek

Reputation: 3604

You can try adding below code in your build.gradle file (at the same level as defaultConfig)

buildscript {
    repositories {
        mavenCentral()
    }
}

It should resolve your problem.

Upvotes: 0

Related Questions