Skip to content

Local jar files dependencies are discarded in the artifact deployed by Jitpack #383

@VictorAlbertos

Description

@VictorAlbertos

Hi, first of all, my knowledge using Jitpack is very limited (and Maven), so probably the next question is a little dummy.

I have this project, it is a java library project, specifically is the rx_cache module which I'm talking about it. I started using gradle to resolve the “guava” dependency as follow:

dependencies {
    compile ’com.google.guava:guava:11.0.2'
}

There were no problem. When requiring the artefact generated by Jitpack, all worked fine.

But I realised that guava increased the total methods count of my library project in about 11.000. This is a problem for a library which most of its potential users could be android developers. So, I downloaded directly the guava jar and I shrank it with proguard. After that, the methods count were down to 1.100. Much better.

But now, in order to resolve the guava dependency, I have a jar file in libs folder, and it is referenced in gradle as follows:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

The library works perfectly well when I reference it from another module in the same project. Or even If I run the test, it is still working. But when I try to use it throughout Jitpack, the jar seems to be not include as reference in the artifact, because I can see that when decompiling the apk file. And for that reason, whatever project that uses my library crashes with the next error:

java.lang.NoClassDefFoundError: Failed resolution of: //several classes

It does not matter what jar I include as dependency. I tried others jars because I thought maybe the problem could be related by the fact that I shrank the jar file with proguard. But It is not the problem, because any jar I include is discarded in the final artifact.

So, my question is how can I retain jar files in my project library in order to prevent they be discarded when Jitpack generates the artifact? I know this is not a problem related with Jitpack, but I don’t know how to resolve it.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions