上传到 App Store 时二进制文件无效

Invalid binary when uploading to App Store

我之前使用过以下功能,目前我没有使用它,所以我从 info.plist 中删除了它,但是我在上传应用程序时遇到了问题。我不想将这些功能添加到 info.plist,因为我不再使用它们了。我该怎么办?

ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSPhotoLibraryUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSCameraUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs.

如果您看到该警告,App Store(通过自动查看您编译的应用程序)认为您正在使用这些功能。通常这意味着您的应用程序中存在引用这些 API 的代码。在这种情况下,它是与相机和照片库一起使用的代码。即使您不再使用这些功能,如果您编译的二进制文件中的代码引用了这些 API,Apple 也会坚持在您的 info.plist 中出现这些目的(因为他们无法分辨这些功能之间的区别存在并使用,或存在但未使用)。

您的选择是:

  • 如果您认为这些功能不会回归,请从您的应用中完全删除使用这些 API 的代码。您可能还想暂时不包含这些文件,方法是将它们从应用程序的构建目标中删除。
  • 如果这太复杂,并且您确定这些功能实际上不再在您的应用中使用,那么请使用您之前收到的任何消息填写 info.plist 的那些部分,安全的是,没有用户会真正看到它们。

总而言之,如果您引用这些 API,即使您不使用它们,您也必须在应用的 info.plist.

中具有适当的目的字符串