Xcode adds dependency to MapKit unconditionally

Originator:sasmito.adibowo
Number:rdar://44664610 Date Originated:21 September 2018
Status:Open Resolved:
Product:Xcode Product Version:10.0
Classification:Critical Reproducible:Always
 
Summary:

When Xcode 10 builds an app including a Photo Editing extension, it always adds a dependency to MapKit, even when the main app and the app extension does not make use of maps functionality. This caused App Review rejection.

Steps to Reproduce:

1. Create a single-window macOS application with Swift 4.2 as the programming language (use the sample template from Xcode).
2. Add a Photos Editing extension to the app.
3. Build the application on macOS High Sierra.

Expected Results:

Since this is essentially a “blank application”, the dependencies should be minimal.  Specifically there must not be any dependency to the MapKit framework.

Actual Results:

Xcode includes “libswiftMapKit.dylib” into the application bundle’s Frameworks directory. In turn this forces the app to have a dependency to MapKit and causes App Store review rejection if the app does not have maps functionality.

Please refer to the attached sample project. This project is essentially created from Xcode sample templates. The build results is in folder "Build-Debug" and was obtained from the debug build of the project whereas the project is in folder "TestApp". You can see for yourself that in package `TestApp.app` in the `Frameworks` folder there is `libswiftMapKit.dylib` despite there is no "import MapKit" statement in the project.

Version/Build:

- Xcode 10 version 10.0 (10A254a)
- macOS High Sierra version 10.13.6 (17G65)

Configuration:

- MacBook Pro early 2013

Sample Project: https://github.com/adib/Xcode-10-MapKit-Dependency

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!