Giter VIP home page Giter VIP logo

invalid archive returned from 'https://api.mapbox.com/downloads/v2/mapbox-common/releases/ios/packages/24.3.0-beta.1/MapboxCommon.zip' which is required by binary target 'MapboxCommon' about mapbox-maps-ios HOT 5 CLOSED

vijayprmar avatar vijayprmar commented on June 11, 2024 6
invalid archive returned from 'https://api.mapbox.com/downloads/v2/mapbox-common/releases/ios/packages/24.3.0-beta.1/MapboxCommon.zip' which is required by binary target 'MapboxCommon'

from mapbox-maps-ios.

Comments (5)

multiusersystem avatar multiusersystem commented on June 11, 2024 6

Did you set up .netrc before attempting to add the mapbox-maps-ios package? I didn't, and I got the same error. Here's how I fixed it on my system:

  1. Ensure .netrc has permissions 0600 and looks like this:
machine api.mapbox.com
login mapbox
password YOUR_SECRET_MAPBOX_ACCESS_TOKEN
  1. Check your swiftpm cache:

Check if you have any files in ~/Library/Caches/org.swift.swiftpm that contain something like this:

{"message":"Not Authorized - No Token","url":"[GET] /downloads/v2/mobile-maps-core/releases/ios/packages/11.2.0/MapboxCoreMaps.xcframework-dynamic.zip","auth":"<no access token>","ua":"Amazon CloudFront"}

{"message":"Not Authorized - Invalid Token","url":"[GET] /downloads/v2/mapbox-events-ios/releases/ios/packages/1.0.5/MapboxMobileEvents.zip?access_token=wrong_password","auth":"wrong_password","ua":"Amazon CloudFront"}

if you do, then remove the files:

for f in $(grep -rIl "Not Authorized" ~/Library/Caches/org.swift.swiftpm); do echo "deleting $f"; rm $f; done
  1. Restart Xcode

This solved it for me, but it might be possible for one of those "Not Authorized" artifacts to still be in your project cache~/Library/Developer/Xcode/DerivedData/<your-repo-name>/SourcePackages/artifacts

This is the part where I was wrong

I ran into this issue as well. I followed documentation at https://docs.mapbox.com/ios/maps/guides/install/#add-the-dependency for Swift Package Manager

environment:
MacOS 14.1.1
XCode 15.3

repro:

  1. add mapbox token to .netrc (Downloads:Read permission, 0600) ---not true
  2. add public token to Info.plist
  3. File > Add Package Dependencies, search for https://github.com/mapbox/mapbox-maps-ios.git
  4. Dependency Rule: Up to Next Major Version 11.0.0
  5. Add Package

Swift Package Manager pulls 11.2.0, and produces this output:

invalid archive returned from 'https://api.mapbox.com/downloads/v2/mapbox-common/releases/ios/packages/24.2.0/MapboxCommon.zip' which is required by binary target 'MapboxCommon'
invalid archive returned from 'https://api.mapbox.com/downloads/v2/mobile-maps-core/releases/ios/packages/11.2.0/MapboxCoreMaps.xcframework-dynamic.zip' which is required by binary target 'MapboxCoreMaps'

notes:
I specified some exact versions, and this issue only reproduced on 11.2.0. 11.0.0, 11.1.0, 11.2.0-rc.1, and 11.3.0-rc.1 all had no issues.

Interestingly, I was able to get 11.2.0 (11.0.0 - Next Major Version) on a different system following the above repro steps without issue a few weeks ago... ah, I found my issue! I hadn't added .netrc on this system before attempting to install.

solution:
add .netrc and remove cache files

from mapbox-maps-ios.

Sabina29 avatar Sabina29 commented on June 11, 2024 1

Hi! Wondering if you were able to get around this? If so, can you let me know how you did it because I am facing the same issue?

from mapbox-maps-ios.

shearos avatar shearos commented on June 11, 2024 1

because I also didn't setup the .netrc file properly I had to delete caches.
Make sure to do files in /Users/{username}/Library/Caches/org.swift.swiftpm/artifacts also

from mapbox-maps-ios.

persidskiy avatar persidskiy commented on June 11, 2024

@vijayprmar Hi, please add the steps to reproduce this issue

from mapbox-maps-ios.

1plam avatar 1plam commented on June 11, 2024

Did you set up .netrc before attempting to add the mapbox-maps-ios package? I didn't, and I got the same error. Here's how I fixed it on my system:

  1. Ensure .netrc has permissions 0600 and looks like this:
machine api.mapbox.com
login mapbox
password YOUR_SECRET_MAPBOX_ACCESS_TOKEN
  1. Check your swiftpm cache:

Check if you have any files in ~/Library/Caches/org.swift.swiftpm that contain something like this:

{"message":"Not Authorized - No Token","url":"[GET] /downloads/v2/mobile-maps-core/releases/ios/packages/11.2.0/MapboxCoreMaps.xcframework-dynamic.zip","auth":"<no access token>","ua":"Amazon CloudFront"}

{"message":"Not Authorized - Invalid Token","url":"[GET] /downloads/v2/mapbox-events-ios/releases/ios/packages/1.0.5/MapboxMobileEvents.zip?access_token=wrong_password","auth":"wrong_password","ua":"Amazon CloudFront"}

if you do, then remove the files:

for f in $(grep -rIl "Not Authorized" ~/Library/Caches/org.swift.swiftpm); do echo "deleting $f"; rm $f; done
  1. Restart Xcode

This solved it for me, but it might be possible for one of those "Not Authorized" artifacts to still be in your project cache~/Library/Developer/Xcode/DerivedData/<your-repo-name>/SourcePackages/artifacts

This is the part where I was wrong

Works like a charm! Much appreciated.

from mapbox-maps-ios.

Related Issues (20)

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.