Carthage: Invalid ZIP downloaded

Created on 20 Dec 2017  路  7Comments  路  Source: Carthage/Carthage

Hi,

I've run into an issue with my colleagues, we're moving our projects from Cocoapods to Carthage as we're interested in speeding up our build times so we love the feature of using pre-built binaries as we think that this is the way to go.

For this purpose we created a repo where we keep built binaries we use in our project so we have shared cache of our mostly used libraries which do not provide binary in releases on Github.

Thing is that one of our colleagues has the issue that when downloading linked binary, the zip downloads corrupted repeatedly and we can't figure out what is wrong as all of us have this one working.

We tried creating the archive using compress in Finder, using carthage archive as recommended and using zip from command line directly. None worked for the particular device.

It would be great if you could give me a hand to figure out what is wrong with his device.

Thanks for your help.

  • carthage version: 0.27.0
  • xcodebuild -version: 9.2 (9C40b)
  • Are you using --no-build? no
  • Are you using --no-use-binaries? no
  • Are you using --use-submodules? no
  • Are you using --cache-builds? no

Cartfile

binary "https://raw.githubusercontent.com/olejnjak/CommonDependencies/master/Marshal/Marshal.json" ~> 1.2

Carthage Output

Tomas-MBP:tmp tomasholka$ carthage update 
*** Downloading binary-only framework Marshal at "https://raw.githubusercontent.com/olejnjak/CommonDependencies/master/Marshal/Marshal.json"
A shell task (/usr/bin/env unzip -uo -qq -d /var/folders/2k/2hc5s86d75d4_64tc37y7c000000gn/T/carthage-archive.S9QxzZ /Users/tomasholka/Library/Caches/org.carthage.CarthageKit/binaries/Marshal/1.2.4/Marshal_1.2.4.zip) failed with exit code 9:
[/Users/tomasholka/Library/Caches/org.carthage.CarthageKit/binaries/Marshal/1.2.4/Marshal_1.2.4.zip]
 End-of-central-directory signature not found.  Either this file is not
 a zipfile, or it constitutes one disk of a multi-part archive.  In the
 latter case the central directory and zipfile comment will be found on
 the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /Users/tomasholka/Library/Caches/org.carthage.CarthageKit/binaries/Marshal/1.2.4/Marshal_1.2.4.zip or
       /Users/tomasholka/Library/Caches/org.carthage.CarthageKit/binaries/Marshal/1.2.4/Marshal_1.2.4.zip.zip, and cannot find /Users/tomasholka/Library/Caches/org.carthage.CarthageKit/binaries/Marshal/1.2.4/Marshal_1.2.4.zip.ZIP, period.

All 7 comments

Try deleting both ~/Library/Caches/carthage/ and ~/Library/Caches/org.carthage.CarthageKit and trying again. The former is HTTP caching from the OS. I've seen issues where a corrupted downloaded is continually re-served from that cache, making subsequent downloads from carthage appear corrupted.

You were right, at first I got invalid URL to zip file in my json, so it resulted in 404 from github while trying to download the zip.

I deleted the cache, print this also.

*** Downloading mantis_ios.framework binary at "1.0.0"
A shell task (/usr/bin/env unzip -uo -qq -d /var/folders/vd/cxm9zzdj66q9k996zp51v3j00000gq/T/carthage-archive.NDhH5w /Users/lc/Library/Caches/org.carthage.CarthageKit/binaries/mantis_ios/1.0.0/Frameworks_iOS_v1.0.0.zip) failed with exit code 9:
[/Users/lc/Library/Caches/org.carthage.CarthageKit/binaries/mantis_ios/1.0.0/Frameworks_iOS_v1.0.0.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /Users/lc/Library/Caches/org.carthage.CarthageKit/binaries/mantis_ios/1.0.0/Frameworks_iOS_v1.0.0.zip or
        /Users/lc/Library/Caches/org.carthage.CarthageKit/binaries/mantis_ios/1.0.0/Frameworks_iOS_v1.0.0.zip.zip, and cannot find /Users/lc/Library/Caches/org.carthage.CarthageKit/binaries/mantis_ios/1.0.0/Frameworks_iOS_v1.0.0.zip.ZIP, period.

I'm still having this issue. I've tried deleting both caches but keep getting the same error. I'm able to download the zip file directly from the url and it works fine but when using Carthage it only downloads 9 bytes so it becomes an invalid zip file at that point. It's being hosted on GitHub release. Any thing else I could be missing?

update
looks like the issues is ssh access via carthage. I uploaded the zip to another host that doesn't require auth and it works fine. even --use-ssh didn't do the trick when hosting on github releases.

I'm also experiencing this issue. Has anyone found a solution?

@aramikg did you find a resolution on the authenticated endpoints?

Any solution founded? I'm also experiencing this issue

Was this page helpful?
0 / 5 - 0 ratings