Coder Social home page Coder Social logo

Comments (9)

auxdevelopment avatar auxdevelopment commented on July 3, 2024

Does this occur during the build of the Java client or when building a project that depends on the built client?

from fiskaly-kassensichv-client-java.

 avatar commented on July 3, 2024

When building the project that depends on the built client (Android)

from fiskaly-kassensichv-client-java.

auxdevelopment avatar auxdevelopment commented on July 3, 2024

I'm not sure if we can fix anything about that issue. The duplicate classes come from the OkHttp library and therefore are needed in the fat JAR.

What you could try to do tough is finding a way to exclude duplicate classes during your build. If you're using the java plugin for Gradle then you can set the following value to exclude duplicate classes from your build:

jar {
    duplicatesStrategy = 'exclude'
}

from fiskaly-kassensichv-client-java.

 avatar commented on July 3, 2024

I asked the question on Stackoverflow :
https://stackoverflow.com/questions/58557320/android-how-to-exclude-duplicate-classes-while-importing-a-fat-jar

I'm crossing my fingers to get an answer because I'm really stuck with this problem.

from fiskaly-kassensichv-client-java.

prempador avatar prempador commented on July 3, 2024

@Greelings After a bit of research I found out about packagingOptions:

From here it reads:
Packaging options are configured with three sets of paths: first-picks, merges and excludes:

First-pick
Paths that match a first-pick pattern will be selected into the APK. If more than one path matches the first-pick, only the first found will be selected.
Merge
Paths that match a merge pattern will be concatenated and merged into the APK. When merging two files, a newline will be appended to the end of the first file, if it doesn't end with a newline already. This is done for all files, regardless of the type of contents.
Exclude
Paths that match an exclude pattern will not be included in the APK.

I don't know if this is any help or a solution for you.

Other things I thought about is using our Modules in the repo and adding those with the needed dependencies into your jar instead of using the fat jar we generate.

Hope this can help you somehow.

from fiskaly-kassensichv-client-java.

 avatar commented on July 3, 2024

Thank you.

Other things I thought about is using our Modules in the repo and adding those with the needed dependencies into your jar instead of using the fat jar we generate.

Yes I thought about it too. Because it was working well with earlier versions of the JAR file, imported like this:

implementation files('libs/com.fiskaly.kassensichv.client.android-0.0.1-alpha.jar')
implementation 'com.squareup.okhttp3:okhttp:4.0.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.9'

from fiskaly-kassensichv-client-java.

 avatar commented on July 3, 2024

I tried to find a simple solution all day yesterday, but without success.
I will continue to use the old JAR file I have to be able to continue the integration, praying for you to return to a classic dependency system (at least for Android).

from fiskaly-kassensichv-client-java.

prempador avatar prempador commented on July 3, 2024

There will be more changes to the dependency systems in the next few days / weeks. Hopefully this will fix the issues in the future.

from fiskaly-kassensichv-client-java.

 avatar commented on July 3, 2024

@prempador Perfect, thank you. Let me know when you have some news.

from fiskaly-kassensichv-client-java.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.