4

I recently forked an iOS library on GitHub to add support to it for the Swift Package Manager. Here's the repository: https://github.com/skelpo/mapbox-gl-native-ios

When I add it to a completely new iOS app and try to build it, I get this error:

Unable to resolve build file: XCBCore.BuildFile (The workspace has a reference to a missing target with GUID 'PACKAGE-TARGET:Mapbox')

I've found posts for similar errors, such as this one, but the reason for the build file failing to resolve is different.

I have tried the usual cleaning the build folder, deleting derived data, and restarting Xcode, but that hasn't helped.

What is the reason for this specific resolution failure, and how would I fix it?

Caleb Kleveter
  • 11,170
  • 8
  • 62
  • 92
  • 1
    This seems to be a common issue with Xcode 12. I have the same error with another SPM issue. – Chris Prince Sep 03 '20 at 03:15
  • Were you able to get this figured out? I'm running into a similar issue. – Kyle Nov 03 '20 at 17:02
  • @Kyle I got it fixed, but I can't say for sure what did it. I could have either been an Xcode update or fixing the source for a binary framework, but I don't really know. I wish I did. – Caleb Kleveter Nov 04 '20 at 13:38
  • My two errors were related to a test target that was dependent nf two.other test targets. I commented out that testTarget, and it worked fine. – Mark Lilback Nov 10 '20 at 21:25

1 Answers1

0

I ran into a similar problem after upgrading to Xcode 12 recently, and found a fix for my case.

A major hint that led to the solution came from Aaron's May 3, 2019 answer on this page.

What fixed it for me was to select the root of the Xcode project, and change the Project Format from "Xcode 11.0-compatible" to "XCode 12.0-compatible".

Bob Murphy
  • 5,814
  • 2
  • 32
  • 35