feedback-assistant / reports

Open collection of Apple Feedback Assistant reports
220 stars 2 forks source link

FB10023924: "ITMS-90683: Missing Purpose String in Info.plist" email should not be sent when simply importing the Photos framework on macOS #308

Open sindresorhus opened 2 years ago

sindresorhus commented 2 years ago

Description

I have some reusable code that’s included in all my apps that imports the “Photos” framework. The app in question does not use this code at all, but because of a configuration change in Xcode, it did not get optimized out (compilation mode in Xcode changed from “Whole Module” to “Incremental”). App Store Connect detected the “Photos” import, invalidated the binary, and sent an email telling me to add a NSPhotoLibraryUsageDescription usage string.

There are many things wrong with this:

  1. The app does not actually use this the “Photos” framework. It’s simply imported. Having to guard code behind compilation macros just to please App Store Connect is not desirable.

  2. macOS already requires a sandbox entitlement to access the photo library (“com.apple.security.personal-information.photos-library”). So it would be better to check for that rather than an import in code that may not even be used. It would result in a lot less false-positives.

  3. The email does not indicate exactly where in the code the violation occurs. There’s no other way to debug this than to submit new builds and hoping you managed to guess your way to the solution, which is a very time consuming and annoying process.

I have attached a screenshot of the incorrect violation email.

Files

Screen Shot 2022-05-21 at 18 46 35
sindresorhus commented 2 years ago

Apple reply:


It seems like the issue is resolved now, as you were able to successfully import the last several builds in App Store Connect. Please confirm the issue is resolved. If you would still like to submit the above as feedback, we’d be happy to submit it on your behalf.

sindresorhus commented 2 years ago

My reply:


Cause: Turns out I had turned off compiler optimization in Xcode because of a Swift optimization bug and I had forgotten to turn it back on. Since there were no optimizations, the import was not removed as dead code.

However, I think my report is still valid. There may be situations where dead code removal is not possible. The build should not be failed because of simply importing a module. At minimum point 1 and 2 still apply.

In addition, for valid cases, it would be better to perform the validation locally instead of notifying the user later on and forcing them to upload a new build.