当将应用程序上传到 Mac 商店时,得到的 API 分析太大

我要把我的第一个 Mac 应用上传到苹果商店

并修正了所有验证错误的图标,类别..。

但在那之后,我通过了验证,并发出了警告:

The resulting API analysis file is too large. We were unable to validate your API usage prior to delivery. This is just an informational message.

我的上传被拒绝的原因是“无效二进制”
有没有人有这方面的经验?


更新: 这个警告不是拒绝的原因,它可能是应用程序归档问题。我成功地发布了我的应用程序。

所以,我们可以放心地忽略这一点。

44258 次浏览

Apple forbids using private or undocumented APIs in iOS apps. Any calls you make to methods that have the same name as private or undocumented API methods will be flagged as a private API use, even if the method being called is something you have defined yourself.

App Loader does an initial scan, checking for method names, instance variable access, and even @selector usage with private method names. App Loader doesn't always do a great job, and the more source files you have the more likely it is to give you the warning that the API analysis file it has generated is "too large".

Fortunately, you can still submit your application, despite of the warning. Apple will check it internally, and if something gets kicked back because of overlapping names, you'll have to wade through the review process again.

Erika Sadun tried to make an app called API Kit that would do the scanning for you, but she appears to have abandoned her work and removed any trace of the application from her website.

Chimp Studios created App Scanner to do the same thing, but it hasn't been updated since 2011. Unfortunately, for large projects -- and this includes projects with a lot of extra pods from CocoaPods -- there is no current (2014) good way of solving this problem other than proactively naming things such that they won't conflict with private API method and instance names.

You can proactively learn about Apple's Cocoa Naming Conventions and try to anticipate. That will reduce future headaches. Until Apple introduces something like namespaces, however, we may continue to run into this problem from time to time.

The "invalid binary" error can come from a number of causes, but it is entirely unrelated to the API analysis document created by App Loader.

You should know that even with the scanning, there are still ways to get around the prohibition on using private/undocumented APIs. :)

Here is an easy way to get around them... store the selector name in reverse, like "dlroWolleH", then reverse the string before you call the method.

If Apple gets wise to that then you can encrypt them.

After hitting this issue for the first time on my first Swift project, it looks like the most common answer to this question is now:

If you use Swift 2.x and XCode 7, you'll get this error. Just ignore it.

[UPDATE: XCode 7.3 & iOS 9.3 rollout seems to have fixed this issue!]