4

Has someone had any success in using Shadow Gradle Plugin to generate AAR? I am getting an error Could not find method shadowJar(). This is my configuration

plugins {
 id 'com.android.library'
 id 'kotlin-android'
 id 'com.github.johnrengelman.shadow' version '6.0.0'
}

android { ... }

shadowJar {
 baseName = 'shadow'
 classifier = ''
 archiveVersion = ''
}

1 Answers1

0

Here is the right way of declaring shadowJar task in your build.gradle file:

Apply the plugin

plugins {
    ...
    id "com.github.johnrengelman.shadow" version "6.1.0"
}

Import it

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

Write the task

task shadowJar(type: ShadowJar) {
    println("Hello from shadowJar task")
}
Taras Mykhalchuk
  • 829
  • 1
  • 9
  • 20