Search code examples
iosswiftiphonexcodeswift-package-manager

How to use binary or xcFramework in .zip format hosted in private repo using SPM


I want to use GoogleMaps SDK using SPM so I followed this url https://github.com/YAtechnologies/GoogleMaps-SP.

Below are steps which I did

STEP 1: Uploaded all 5 xcFrameworks to nexus. E.g: https://xxx/google/google-maps/5.0.0/google-map.zip

STEP 2: Created a package.swift file with all above xcFramework zip urls and uploaded to gitLab. So its same as https://github.com/YAtechnologies/GoogleMaps-SP/blob/main/Package.swift. only zip urls will be replaced with our nexus url.

STEP 3: Successfully able to add in Xcode. File > Swift Packages > Add Package Dependency

Successfully able to run after  File > Swift Packages > Reset Packages Cache.

Issue: But the problem is whenever i run pod Install or change branch, I am getting below error

  • artifact of binary target 'GoogleMaps' failed extraction: The operation couldn’t be completed. (TSCBasic.StringError error 1.)

  • artifact of binary target 'GoogleMapsBase' failed extraction: The
    operation couldn’t be completed. (TSCBasic.StringError error 1.)

  • artifact of binary target 'GoogleMapsCore' failed extraction: The operation couldn’t be completed. (TSCBasic.StringError error 1.)

  • artifact of binary target 'GoogleMapsM4B' failed extraction: The operation couldn’t be completed. (TSCBasic.StringError error 1.)

  • artifact of binary target 'GooglePlaces' failed extraction: The operation couldn’t be completed. (TSCBasic.StringError error 1.)

Temporary solution is reseting package content by “File > Swift Packages > Reset Packages” in xcode.

So what could be permanent solution of this because if I directly use public https://github.com/YAtechnologies/GoogleMaps-SP.git as dependency then I am not facing this issue of reseting package content again and again. Might be I am using private xcFramework zip urls or repo that is why I am getting this error. So any one has any clue what. could be the solution.

It could be that SPM is buggy https://github.com/firebase/firebase-ios-sdk/issues/7363


Solution

  • This problem is resolved in Xcode 13 and swift 5.0 or >5.0.