Hello,
I'm battling with a real frustrating error when archiving my project. All works well when building or running to a device or simulator, while archiving however I get this error:
Undefined symbols for architecture arm64: "Swift.UnsafeMutableBufferPointer.(subscript.materializeForSet : (Swift.Int) -> A).(closure #1)", referenced from: function signature specialization <Arg[2] = Exploded> of generic specialization <Swift.UnsafeMutableBufferPointer<Library.Thing> with Swift.UnsafeMutableBufferPointer<Library.Thing> : Swift.MutableCollection in Swift and Swift.UnsafeMutableBufferPointer<Library.Thing> : Swift.RandomAccessCollection in Swift> of Swift._siftDown <A where A: Swift.MutableCollection, A: Swift.RandomAccessCollection> (inout A, index : A.Index, subRange : Swift.Range<A.Index>, by : inout (A.Iterator.Element, A.Iterator.Element) -> Swift.Bool) -> () in Manager function signature specialization <Arg[1] = Exploded> of generic specialization <Swift.UnsafeMutableBufferPointer<Library.Thing> with Swift.UnsafeMutableBufferPointer<Library.Thing> : Swift.MutableCollection in Swift and Swift.UnsafeMutableBufferPointer<Library.Thing> : Swift.RandomAccessCollection in Swift> of Swift._heapSort <A where A: Swift.MutableCollection, A: Swift.RandomAccessCollection> (inout A, subRange : Swift.Range<A.Index>, by : inout (A.Iterator.Element, A.Iterator.Element) -> Swift.Bool) -> () in Manager function signature specialization <Arg[1] = Exploded> of generic specialization <Swift.UnsafeMutableBufferPointer<Library.Thing> with Swift.UnsafeMutableBufferPointer<Library.Thing> : Swift.MutableCollection in Swift and Swift.UnsafeMutableBufferPointer<Library.Thing> : Swift.RandomAccessCollection in Swift> of Swift._partition <A where A: Swift.MutableCollection, A: Swift.RandomAccessCollection> (inout A, subRange : Swift.Range<A.Index>, by : inout (A.Iterator.Element, A.Iterator.Element) -> Swift.Bool) -> A.Index in Manager function signature specialization <Arg[2] = Exploded> of generic specialization <Swift.UnsafeMutableBufferPointer<Swift.String> with Swift.UnsafeMutableBufferPointer<Swift.String> : Swift.MutableCollection in Swift and Swift.UnsafeMutableBufferPointer<Swift.String> : Swift.RandomAccessCollection in Swift> of Swift._siftDown <A where A: Swift.MutableCollection, A: Swift.RandomAccessCollection> (inout A, index : A.Index, subRange : Swift.Range<A.Index>, by : inout (A.Iterator.Element, A.Iterator.Element) -> Swift.Bool) -> () in Manager function signature specialization <Arg[1] = Exploded> of generic specialization <Swift.UnsafeMutableBufferPointer<Swift.String> with Swift.UnsafeMutableBufferPointer<Swift.String> : Swift.MutableCollection in Swift and Swift.UnsafeMutableBufferPointer<Swift.String> : Swift.RandomAccessCollection in Swift> of Swift._heapSort <A where A: Swift.MutableCollection, A: Swift.RandomAccessCollection> (inout A, subRange : Swift.Range<A.Index>, by : inout (A.Iterator.Element, A.Iterator.Element) -> Swift.Bool) -> () in Manager function signature specialization <Arg[1] = Exploded> of generic specialization <Swift.UnsafeMutableBufferPointer<Swift.String> with Swift.UnsafeMutableBufferPointer<Swift.String> : Swift.MutableCollection in Swift and Swift.UnsafeMutableBufferPointer<Swift.String> : Swift.RandomAccessCollection in Swift> of Swift._partition <A where A: Swift.MutableCollection, A: Swift.RandomAccessCollection> (inout A, subRange : Swift.Range<A.Index>, by : inout (A.Iterator.Element, A.Iterator.Element) -> Swift.Bool) -> A.Index in Manager ld: symbol(s) not found for architecture arm64
The relevant part looks a bit like this:
let meta:MetaData? if let context = context { meta = MetaData.mr_findFirst(in: context) } else { meta = MetaData.mr_findFirst() } if let things = meta?.availableThings?.allObjects as? [Thing] { return things.sorted(by: { (a, b) -> Bool in return true }) }
The cast is there to make things a bit more obvious - the Set<Thing> is casted to [Thing], but sorted(by:) crashes the linker. A more direct approach (sorting on the Set etc) causes the same issues. Maybe NSSortDescriptor can help me work around it for now?
Can anyone help? Thanks!