How to stop XCode from autolinking Libraries

Hi,

I have been rejected because my App links against MapKit, but does not use it.

I verified and otool -L finds this
Code Block
@rpath/libswiftMapKit.dylib (compatibility version 1.0.0, current version 2.0.0, weak)

But I have no idea where this comes from
• it is not in my list of linked Libraries
• MapKit is not appearing anywhere in my Code (no "import MapKit" or anything)
• I don't use any thing that starts with an MK
• I do not include or link against non Apple Libraries

What I do have is
• a 5.3 Swift code except for
• Zip Library and for it linker flags -lz and -liconv

What could trigger the linking against MapKit?
How can I isolate this problem?
I am truly stuck and could use some pointers.

All the best
Christoph
This is most likely happening because something you're using has APIs for MapKit. As an example, PhotoKit has PHProjectMapElement which uses MapKit types and will cause the MapKit Swift overlay to be imported, even if you're not using PHProjectMapElement.

To pinpoint the source, I'd create a new app from an Xcode template, and add the Apple frameworks you're using one by one, inspecting the built binary with otool -L in Terminal after adding each one until you identify the source. Once you get that info, you should let App Review know.
Solution: It is autolinked when I use PhotosUI, which is necessary because my app is a Photos Project Extension – it took the reviewer a while to accept, but after contacting other people in Apple it was going through. However the update was delayed for a week and was rejected multiple times for this bogus reason.
How to stop XCode from autolinking Libraries
 
 
Q