Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate zip entry causing build failures #30

Closed
mattyway opened this issue Dec 11, 2017 · 8 comments
Closed

Duplicate zip entry causing build failures #30

mattyway opened this issue Dec 11, 2017 · 8 comments

Comments

@mattyway
Copy link

mattyway commented Dec 11, 2017

I just tried updating to Kotlin Logging 1.4.7 but when I try to build my project, I get the following error:

Warning:Exception while processing task java.io.IOException: Can't write [D:\AndroidApp\Repo\app\build\intermediates\transforms\proguard\debug\0.jar] (Can't read [C:\Users\User\.gradle\caches\modules-2\files-2.1\io.github.microutils\kotlin-logging\1.4.7\8b05153a42982548197a87f0aed852c8804c943f\kotlin-logging-1.4.7.jar(;;;;;;**.class)] (Duplicate zip entry [kotlin-logging-1.4.7.jar:mu/internal/KLoggerFactory.class]))

The SHA-1 hash of kotlin-logging-1.4.7.jar in my gradle cache is: 8B05153A42982548197A87F0AED852C8804C943F

The jar has duplicate entries for every .class file when viewed in 7-zip. I examined the .class files in a text editor and it seems like one file is using the string "kotlin-logging" and the other is using "kotlin-logging_main".

@mattyway
Copy link
Author

Reverting to 1.4.6 allows me to build my project again.

@oshai
Copy link
Owner

oshai commented Dec 11, 2017 via email

@oshai
Copy link
Owner

oshai commented Dec 11, 2017

I am unable to reproduce the issue. looking at the jar here I did not find duplicate entries: https://dl.bintray.com/microutils/kotlin-logging/io/github/microutils/kotlin-logging/1.4.7/
https://mvnrepository.com/artifact/io.github.microutils/kotlin-logging/1.4.7

Also, I tried depends on this version and compile the code and it works.
Let me know if you can help with reproducing or this is something else.
Regards,
Ohad.

@mattyway
Copy link
Author

I tried downloading the .jar from the links provided and they are the same as the .jar in my gradle cache. All of the .jars have the same SHA-1 hash (8B05153A42982548197A87F0AED852C8804C943F). What is the SHA-1 hash of the .jar you have? What operating system are you using?

Here is a screenshot of 7-zip on Windows 10 showing duplicate entries inside the .jar:

Screenshot 1
Screenshot 2

I noticed that the files have different modification dates, some are modified on 2017-12-08 and the duplicates on 2017-07-12.

@hltj
Copy link

hltj commented Dec 12, 2017

I can see the same content as mattyway seen using 7-zip under Windows 10.

And the duplicate entries can also be seen under Linux:

[hltj@localhost ~] $ wget https://dl.bintray.com/microutils/kotlin-logging/io/github/microutils/kotlin-logging/1.4.7/kotlin-logging-1.4.7.jar
[hltj@localhost ~] $ sha1sum kotlin-logging-1.4.7.jar
8b05153a42982548197a87f0aed852c8804c943f  kotlin-logging-1.4.7.jar
[hltj@localhost ~] $ mkdir tmp
[hltj@localhost ~] $ cd tmp
[hltj@localhost tmp] $ unzip ../kotlin-logging-1.4.7.jar 
Archive:  ../kotlin-logging-1.4.7.jar
   creating: META-INF/
  inflating: META-INF/MANIFEST.MF    
  inflating: META-INF/kotlin-logging_main.kotlin_module  
   creating: mu/
   creating: mu/internal/
  inflating: mu/internal/KLoggerFactory.class  
  inflating: mu/internal/KLoggerNameResolver.class  
  inflating: mu/internal/LocationAwareKLogger.class  
  inflating: mu/internal/LocationIgnorantKLogger.class  
  inflating: mu/internal/MessageInvokerKt.class  
  inflating: mu/KLoggable$DefaultImpls.class  
  inflating: mu/KLoggable.class      
  inflating: mu/KLogger$DefaultImpls.class  
  inflating: mu/KLogger.class        
  inflating: mu/KLogging.class       
  inflating: mu/KotlinLogging.class  
  inflating: mu/NamedKLogging.class  
  inflating: META-INF/kotlin-logging.kotlin_module  
replace mu/internal/KLoggerFactory.class? [y]es, [n]o, [A]ll, [N]one, [r]ename: 

@oshai
Copy link
Owner

oshai commented Dec 12, 2017

Thanks, I managed to reproduce it that way. I will create version 1.4.8 which hopefully fix it.

@oshai
Copy link
Owner

oshai commented Dec 12, 2017

let me know if you still have issues with version 1.4.8

oshai pushed a commit that referenced this issue Dec 12, 2017
@hltj
Copy link

hltj commented Dec 12, 2017

It' going well. Thanks.

@oshai oshai closed this as completed Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants