0
  • Where: Build file '/home/jitpack/build/build.gradle' line: 53
  • What went wrong: A problem occurred evaluating root project 'build'.

    Could not find method implementation() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Above is the log when i try to upload a library to jitpack ( which does not have any app sample, only apply plugin: 'com.android.library'). I was uploaded at least 3 project with sample app inside it and it work perfect but this one not. I dont really know what i facing so any one please show me some solutions.

I am posting full log here.

https://jitpack.io/com/github/cuong292/gemcore/-757446dc0a-1/build.log

Below is my app level build gradle file.

apply plugin: 'com.android.library'
android {
    compileSdkVersion 29
    defaultConfig {
        minSdkVersion 17
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
    }

buildTypes {
    release {
        debuggable false
    }
}
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    api "com.android.support:appcompat-v7:28.0.0"
    api "com.android.support:support-v4:28.0.0"
    api "com.android.support:design:28.0.0"
    api "com.android.support:cardview-v7:28.0.0"

    compile "com.jakewharton:butterknife:8.4.1"

    annotationProcessor "com.jakewharton:butterknife-compiler:8.4.1"

    api "com.github.bumptech.glide:glide:4.3.0"
    api "com.google.guava:guava:27.0.1"
    api "org.greenrobot:eventbus:3.1.1"

    api 'org.apache.commons:commons-lang3:3.8.1'
    api 'uk.co.chrisjenx:calligraphy:2.3.0'
    api 'com.makeramen:roundedimageview:2.3.0'
}

// build a jar with source files
task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}

task javadoc(type: Javadoc) {
    failOnError false
    source = android.sourceSets.main.java.sourceFiles
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    classpath += configurations.implementation
}

// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives sourcesJar
    archives javadocJar
}
Kaushik Burkule
  • 816
  • 1
  • 12
  • 27
shadow
  • 114
  • 11

1 Answers1

0

Finally,after hours of work and base on @GabrieleMariotti(thanks u so much) suggest,i find out that my stand alone library need a specify buildtool.And just add buildscript and allprojects (which normaly inside your build.gradle project level) to make it work.And remember to remove all task{}

shadow
  • 114
  • 11