Closed pepas-everly closed 2 years ago
Hmm, here's a clue.
I noticed there are two copies of Device.generated.swift
:
$ find . | grep DeviceKit | grep Device.generated.swift
./Carthage/Checkouts/DeviceKit/Source/Device.generated.swift
./Carthage/Checkouts/DeviceKit/CocoaPodsVerification/Pods/DeviceKit/Source/Device.generated.swift
If I open up Carthage/Checkouts/DeviceKit/CocoaPodsVerification/Pods/DeviceKit/Source/Device.generated.swift
, I see:
/// All iPhones
public static var allPhones: [Device] {
return [.iPhone4, .iPhone4s, .iPhone5, .iPhone5c, .iPhone5s, .iPhone6, .iPhone6Plus, .iPhone6s, .iPhone6sPlus, .iPhone7, .iPhone7Plus, .iPhoneSE, .iPhone8, .iPhone8Plus, .iPhoneX, .iPhoneXs, .iPhoneXsMax, .iPhoneXr]
}
So somehow the wrong copy of Device.generated.swift
is getting used?
Aha, that's it.
*** Building scheme "DeviceKit" in CocoaPodsVerification.xcworkspace
A work-around seems to be to split the carthage command into two parts (fetch, then build), and simply remove the CocoaPodsVerification
directory from the checkout before building.
carthage update --no-build
rm -rf Carthage/Checkouts/DeviceKit/CocoaPodsVerification
carthage build --use-xcframeworks --platform iOS --no-use-binaries --cache-builds
@pepas-everly Yes, there is still an open PR to remove the CocoapodsVerification project (https://github.com/devicekit/DeviceKit/pull/288) but that is yet to be merged. I will see if I have time to update it and getting it merged.
Thanks!
Something strange seems to be going on with my Carthage installation of DeviceKit.
I've tried both
as well as
Usage:
This results in a build error:
If I skip Carthage and instead just manually pull in a copy of
Device.generated.swift
directly into my project, everything works as expected.Through a bit of experimentation, I found that using the framework in a different way appears to work (with Carthage):
I then tried
print(Device.allPhones)
and got this:So it's like an older version of the framework is somehow being used.
If I open up
Carthage/Checkouts/DeviceKit/Source/Device.generated.swift
, I see this:I have no idea how this could possibly be happening. This just doesn't make any sense. I've never installed DeviceKit anywhere on this laptop prior to this, so I don't understand where an older version could possibly be coming from.
I'm using Xcode 13.3, macOS 12.4.