107

I am going to upload my first mac app to Apple Store

And fixed all validation bugs of icon,category...

But after then I passed validation with warning :

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.

And my upload be rejected with the reason : "Invalid binary"
Is there anyone has experience of this case ?


UPDATE : this warning is not the reason of rejecting, it maybe the app archiving problem. I successfully released my app to store.

So, we can safely ignore that.

David Ansermot
  • 6,052
  • 8
  • 47
  • 82
arasa
  • 1,215
  • 2
  • 10
  • 9
  • 1
    Could you solve this problem? I have the same problem and I don't know what to do! – nosmirck Jun 26 '14 at 15:25
  • 1
    Received this too. I can't find a source anywhere to accurately explain what it means? – Andrew Davis Aug 05 '14 at 09:22
  • This older answer might help. I believe the initial warning mesage is unrelated to the error: http://stackoverflow.com/questions/3433360/what-can-cause-invalid-binary-with-no-email-followup-from-itunes-connect – Steve Tauber Aug 09 '14 at 00:45
  • any luck solving this? – Ahmed Z. Sep 22 '14 at 07:58
  • 5
    I just upgraded my very small shipping app from Swift 1.2 to Swift 2 and get this error. No additional functionality. This has pretty much got to actually be a shortcoming in their analysis tool. (This is for an iOS app, in Xcode 7, not Mac store.) – Ray Fix Sep 20 '15 at 01:31
  • 2
    Same as Ray Fix, not using any private API, just upgrading code from Objective-C to swift – Jerome Diaz Sep 20 '15 at 18:58
  • 1
    Same as above, no private APIs, just used Xcode 7 and i got. – DevC Sep 25 '15 at 16:26
  • 1
    The answers provided are outdated. Now this issue is mostly related to Xcode and Swift update. – JDG Oct 10 '15 at 00:13
  • 1
    Got the same issue in Xcode 7 after adding a Swift 2 extension to an existing Objective-C class. Did somebody open a radar report for this assuming that we all agree that it is a bug in the Xcode analysis tool? – The Dude Oct 14 '15 at 07:42
  • 1
    I have this issue, after updating to Xcode 7 too. Did any of you who have the same problem as me, find a solution to it? So here's my problem, I have an iOS app which I built using Xcode 6 and I have released to the App Store, I updated it 3 times and it was all fine. Now just last week, I updated my app to be Xcode 7 compatible and to use Swift 2, and now when I try to upload it to the App Store fore review, I get this problem. – cptdanko Oct 17 '15 at 01:45
  • [Check this answer, too](http://stackoverflow.com/a/42544671/1136253) – Bengi Besçeli Mar 04 '17 at 18:19

3 Answers3

65

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. :)

Aviram Netanel
  • 12,633
  • 9
  • 45
  • 69
lswank
  • 2,471
  • 1
  • 24
  • 21
  • Are you saying that this "too large" error is a purely mislabeled error? That it *always* indicates some kind of invalid API usage? How have you made this connection? – Chris Prince Sep 17 '15 at 15:30
  • I realize the question was about the Mac App store but for the iOS app store, this answer is not fully correct. I just had this warning when I tried to validate my app with Xcode 7 GM, but when I actually uploaded it to ITC with Xcode 7 GM, there were *no* problems. – Chris Prince Sep 17 '15 at 18:16
  • What's the hint... that you're implying on your last sentence? – makerofthings7 Oct 07 '15 at 02:43
  • Thank you for a very helpful answer. Do you know where the API Analysis file is to be found. I'd like to root out every warning from my app – user462990 Nov 29 '15 at 12:54
  • So if iTunes Connects show that the build is uploaded, that means despite this error message, it did go through? And all I do now is wait for their approval? – Jay Jan 02 '17 at 15:22
10

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!]

Richard
  • 1,249
  • 16
  • 25
  • I'm using Swift 2.1 in Xcode 7.3 and this seems to be the case. Hopefully they'll fix it soon. – Dai Mar 07 '16 at 06:28
  • jap, i m also using Swift 2.1.1 and xCode 7.2.1 get this info... i will let u know if it pass. – HitEmUp Mar 16 '16 at 17:59
2

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.

Mike Crawford
  • 2,232
  • 2
  • 18
  • 28
  • 48
    Or you can follow the review guidelines and not use private API. – Maciej Swic May 29 '15 at 08:45
  • This isn't going to stop anything. They will be able to detect if the method is called from the method itself. Not from the selector name you use. – nicktones Sep 24 '15 at 11:33
  • 2
    @nicktones it's possible to not call the private methods until a point in the future, such as after your app is approved – powerj1984 Oct 15 '15 at 03:36