question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gradle task does not work with version 7.0

See original GitHub issue

Gradle version 7.0 now reports the following error: - Type 'JarjarTask' property 'destinationDir' is missing an input or output annotation.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:9

github_iconTop GitHub Comments

1reaction
andobcommented, Dec 13, 2021

I just realized, we can use jitpack.io to import the latest snapshot of the plugin (which is compatible with Gradle 7) into our projects.

To import the plugin:

Legacy Gradle API:

build.gradle

buildscript {
    repositories {
        //........................
        maven { url "https://jitpack.io" }
        //........................
    }
    dependencies {
        //........................
        classpath 'com.github.shevek.jarjar:jarjar-gradle:9a7eca72f9'
    }
}

app/build.gradle

apply plugin: 'org.anarres.jarjar'

New Gradle API:

settings.gradle

pluginManagement {
  repositories {
        //........................
        maven { url "https://jitpack.io" }
        //........................
  }
}

app/build.gradle

plugins {
    //.................
    id 'org.anarres.jarjar'
}

To use the plugin:

For instance, to import Apache Tika excluding org.apache.tika.io.MappedBufferCleaner that uses MethodHandle API which is missing on Android API level < 26:

app/build.gradle

dependencies {
    //................................................................
    implementation jarjar.repackage {
        from 'org.apache.tika:tika-core:2.1.0'
        classDelete 'org.apache.tika.io.MappedBufferCleaner'
    }
    //................................................................
}

@ungesehn @matthewhague @cah-anuj-shrivastava @thomasstache @AlexKrupa @cmathew @jgremmen

0reactions
cmeng-gitcommented, Apr 25, 2022

I am not sure now what my previous comment is correct. When I changed the scripts to the following, found that 1 of 3 output *.jar indeed get renamed to “fmj-1.0.1-jitsi.jar”. As I am not familiar with jarjar-gradle, may be someone can give me a hint on how to merged all the output jar files into one, before the file rename process.

    implementation jarjar.repackage("fmj-1.0.1-jitsi.jar", {
        from('org.jitsi:fmj:1.0.1-jitsi')

        // remove extracted modules for changes
        classDelete 'net.sf.fmj.media.RegistryDefaults'
        classDelete 'javax.media.format.VideoFormat'
        classDelete 'javax.media.Manager**'
    })
Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading your build from Gradle 7.x to the latest
In previous Gradle versions, mustRunAfter constraints between regular tasks and finalizer task dependencies would not be honored. For a concrete example, ...
Read more >
Troubleshooting builds - Gradle User Manual
If gradle --version works, but all of your builds fail with the same error, it is possible there is a problem with one...
Read more >
Gradle 7.0 Release Notes
Validate missing dependencies between tasks ... One of the potential problems now flagged is a task that consumes the output produced by another...
Read more >
Solving common problems - Gradle User Manual
Currently Gradle only tracks on a per-task basis that no file encoding has been specified, but it does not track the system encoding...
Read more >
What's new in Gradle 7.0
Note, unlike a multi-project build, running gradle build will not run the build task in all of the included builds. You could introduce...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found