Instabug/Instabug-SP

Xcode binary failure

yonaskolb opened this issue ยท 5 comments

When Instabug is integrated as a package in Xcode, resolution of the packages often fails with the error:

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

108807434-85ad5300-75f8-11eb-80bb-632b1d571230

It seems to be some sort of race condition in Xcode. When the Xcode project is open and the project changes on disk (from a git checkout for example), Xcode actually resolves the packages twice. During that process the error above happens consistently. Our project has other SPM binary dependencies as well though that work fine for some reason. Instabug is always the one that fails.
This issue seems to be fixed in the Xcode 13, but is present in current versions.

I was able to workaround this issue by forking this repo and making the following changes:

  • committing the Instabug.xcframework right into the repo
  • updating the Package.swift to make the binary dependency use a relative path rather than an external URL

This then seems to solve the issue in Xcode.
https://github.com/yonaskolb/Instabug-SP/blob/master/Package.swift

Would this be something this repo could officially adopt? It would probably simplify your deployment process as well as you wouldn't have to upload the binary to https://ios-releases.instabug.com anymore

We decided to go with this approach (uploading the binaries elsewhere and include an external URL in the Package.swift) to workaround an inevitable problem with SPM. The thing is, SPM clones the whole repo when installing any dependency, and if we keep uploading binaries this will cause the repo's size to keep growing forever and will even hit the 1GB mark very soon, which will in turn dramatically increase the installation time.

However, we have not encountered the error you're experiencing before. It's good news that it's fixed in newer xcodes, but we'll keep an eye on that ๐Ÿ‘

Yep i am also getting this issue.

Strange that it only happens sometimes. It's quite frustrating.

I'm getting this error, too.
Screen Shot 2021-08-26 at 2 34 16 PM

I'm seeing this in Xcode 13 as well. Although I've not been able to reliably reproduce it.

Xcode 12 on the other hand it's caused by anything which causes Xcode to resolve its packages (git operations for example)

Hi @BrentMifsud @banane

  • Make sure to use the following URL for getting Instabug with SPM: https://github.com/Instabug/Instabug-SP
  • The setup we have for SPM is pretty straight forward so I think it may be one of Xcode quirks, can you try clearing the "DerivedData" for Xcode and check if the problem persists ๐Ÿ™