9

I am running into a strange behavior with swiftlint autocorrect. My project uses a library imported through SPM. But when I run the linter, it changes settings like the following

B4621A7323D0A90F00545ADE /* LibraryName in Frameworks */ = {isa = PBXBuildFile; productRef = B4621A7223D0A90F00545ADE /* LibraryName */; };

files = (
    B4621A7323D0A90F00545ADE /* LibraryName in Frameworks */,

packageProductDependencies = (
    B4621A7223D0A90F00545ADE /* LibraryName */,

packageReferences = (
    B4621A7123D0A90F00545ADE /* XCRemoteSwiftPackageReference "library-name" */,

to something like this

B4621A7323D0A90F00545ADE /* BuildFile in Frameworks */ = {isa = PBXBuildFile; productRef = B4621A7223D0A90F00545ADE /* SwiftPackageProductDependency */; };

files = (
    B4621A7323D0A90F00545ADE /* BuildFile in Frameworks */,

packageProductDependencies = (
    B4621A7223D0A90F00545ADE /* SwiftPackageProductDependency */,

packageReferences = (
    B4621A7123D0A90F00545ADE /* RemoteSwiftPackageReference */,

It basically removes all references to the actual library and replaces them with some generic things. I tried adding two different libraries and it did the same to both libraries.

Any idea what might be going on and how I can fix it?

shim
  • 9,289
  • 12
  • 69
  • 108
user1366265
  • 1,306
  • 1
  • 17
  • 28
  • 1
    I got the same issue, but I'm not using SwiftLint autocorrect. Are you using the command from the Xcode menu `File > Swift Packages > Resolve Package Versions`? Maybe that's connected. – Tiziano Coroneo Feb 27 '20 at 14:49
  • I have the same issue when running [this fastlane plugin](https://github.com/SiarheiFedartsou/fastlane-plugin-versioning). Did you ever find a solution? – shim Nov 18 '20 at 14:42

1 Answers1

0

This is not related to SwiftLint autocorrect nor any fastlane plugin as stated in other comments. As far as I can tell, for now, this is an Xcode bug.

Roger Oba
  • 1,292
  • 14
  • 28