Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The app contains or inherits from non-public classes in payload/XXX.APP/XXX: UIKeyboard

I am getting this App Store error while submitting the app. I was able to submit the same app a month ago and i did not have this problem. last time i submitted, it gave me errors but it would still accept the binary atleast. Now it does not even accept the binary. I do use code as follows.

valueTextField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;

I am not sure if any of my library is not meeting the expectation. Is there any other workaround for this?

If i have to send email to apple, should i also send the binary to them? enter image description here

EDIT : Brian, i have done both nm & strings on the .app file . Below is the result. Can you suggest what to do next?

enter image description here

like image 283
Rajashekar Avatar asked Sep 30 '22 12:09

Rajashekar


2 Answers

Your error is unrelated to that specific line of code. When compiled that line reduces down to a call that is effectively:

objc_msgSend(valueTextField, SEL(setKeyboardType:), (NSInteger)2);

There would be no mention of UIKeyboard in your binary.

You can also verify that your code does not reference UIKeyboard by running nm and strings on your binary:

nm MyApp.app/MyApp | grep UIKeyboard
strings MyApp.app/MyApp | grep UIKeyboard

This will show you any string or symbol reference you might have to UIKeyboard. If you don't have any, the commands should be empty otherwise nm would output something like:

U _OBJC_CLASS_$_UIKeyboard

Based on the fact others have run into this, it seems like there's a problem with Apple's submission process right now. If the problem does not go away on its own, you could try the three different submission channels:

  • Upload via the iTunes Connect Web UI
  • Submitting your archive from within Xcode. Window -> Organizer -> Archives -> Submit...
  • Submitting your app via Application Loader.

Update

Looking at your edit, your app does in fact reference UIKeyboard. Since it sounds like your code isn't using UIKeyboard a third-party library may be to blame. You have a couple options:

Track down the commit where the change was introduced:

Since you have a previous release in the app store, you should be able to check out that version of the app from your SCM, build it, run nm MyApp.app/MyApp | grep UIKeyboard and verify you weren't referencing the class. If this is not the case, things are going to be harder and you should skip to my next suggestion.

You can now track down the commit that introduced the dependency by bisecting your commits between the good and the bad. If using git, git bisect is your friend:

  1. git bisect master SHA_OR_TAG_OF_PREVIOUS_RELEASE
  2. Build app.
  3. nm MyApp.app/MyApp | grep UIKeyboard
  4. If good, git bisect good, otherwise git bisect bad.
  5. Repeat steps 2 through 4 until you find the commit that introduced the problem.

Once you find the bad commit, it should be hopefully be clear what library you updated to introduce the problem. You can check for new updates, revert it, or whatever is necessary to fix the problem. If you can't figure out which one caused it immediately, you can perform the next step.

Run nm on frameworks and libraries used by your app:

Since you can't find a reference to UIKeyboard in your code, you're most likely linking to a library that references it. You'll want to run nm on each of those libraries to track to the culprit.

You can find all the frameworks your app links to under "Build Phases" under the "Link Binary With Libraries" phase. You can ignore system frameworks and libraries from other projects in the workspace and just focus on any third-party .a files or frameworks.

If you're using Cocoapods for everything you can go ahead and check libPods-*.a to quickly see if any pods reference the code. If you hit a match, rerun nm piping into less and keep pressing up until you see a pathname and object file name that will point you to the responsible library.

Otherwise, run nm on each .a file and the binary file in each .framework directory.

nm myLibrary.a | grep UIKeyboard
nm SomeComponent.framework/SomeComponent | grep UIKeyboard

Once you get a match you can check to see if there's a new version of the framework or report the issue. If you find it in a library that you shouldn't have been linking to in production, find a way to remove it.

like image 86
Brian Nickel Avatar answered Oct 05 '22 23:10

Brian Nickel


The problem was inside the "LOOKBACK" framework that i recently added. This is .framework file and i was not sure how to do a nm on a .framework file. I tried the below. Both gave me error "can't map file"

nm Lookback.framework | grep UIKeyboard

strings Lookback.framework | grep UIKeyboard

As Brian mentioned i have done nm,strings on all other static library (.a files) i was using, which did not reveal anything concrete.

like image 25
Rajashekar Avatar answered Oct 05 '22 23:10

Rajashekar