Submission error with MPMoviePlayerContentPreloadDidFinishNotification

I just received the following rejection when submitting an update to my game:

Your app contains non-public api usage. please review the errors, correct them, and resubmit your application.
The app references non-public symbols in MPMoviePlayerContentPreloadDidFinishNotification

How do I fix this problem? This is an update to an existing app; obviously previous builds submitted fine. I’m using Unity 4.2.2 with this app because it is really tricky to update the Unity version of this project (eg. incompatible asset bundles)

Poking around the MediaPlayer framework, I found

at the bottom of MPMoviePlayerController.h it says:
// This notification is superseded by MPMediaPlaybackIsPreparedToPlayDidChangeNotification.
MP_EXTERN NSString *const MPMoviePlayerContentPreloadDidFinishNotification NS_DEPRECATED_IOS(2_0, 3_2);

while at the bottom of MPMediaPlayback.h it says:
MP_EXTERN NSString *const MPMediaPlaybackIsPreparedToPlayDidChangeNotification NS_AVAILABLE_IOS(3_2);

Incidentally, my app is currently targeting ios 5; perhaps this deprecated api is only used in ios 5, and this problem will go away by switching the project to ios 6?

ADDITION: I also noticed in Unity’s VideoViewController.h it says:
@interface UnityVideoViewController : MPMoviePlayerViewController {}

So in other words Unity is extending the class with the deprecated function in it’s header. hm…

ADDITION2: Another bit of background that just came up, I’m using XCode 5.1.1 but it looks like the MediaPlayer framework is updated in XCode 6. Given that XCode 6 is a semi-private beta, it would be pretty stupid for Apple to require that to submit an app…

ADDITION3: nnn and now that I’ve tried to build in XCode 6 I’m seeing “Use of undeclared identifier ‘GL_BGRA_EXT’” in Classes/Unity/CMVideoSampling.mm

I found this thread with info about that last issue iOS8 / XCode6 compatibility - Unity Engine - Unity Discussions

ADDITION4: oh goody and now another wrinkle has come up, I found that API documented here MPMoviePlayerController | Apple Developer Documentation

When I click “Notifications” in the left-side menu there’s MPMoviePlayerContentPreloadDidFinishNotification listed. It’s deprecated but it public; perhaps the error from iTunes is simply incorrect…

"Your app contains non-public api usage. please review the errors, correct them, and resubmit your application.
The app references non-public symbols in MPMoviePlayerContentPreloadDidFinishNotification"
Same issue with Unity 4.5.2
UPDATE:
It was issue with old Flurry Ads, not a Unity problem.

Apple has suggested they’re going to fix this. Nothing definite yet, but since the problem was in their MediaPlayer framework and not in code I wrote, and since the error claimed it’s an undocumented API but I found it in their documentation, I contacted their developer support and they said other people have been reporting this issue too so they’re looking into it.

It seems that at least some versions of FlurryAds are using the MPMoviePlayerContentPreloadDidFinishNotification. If one uses Prime31 Flurry plugin, then it is possible to remove FlurryAds in case you aren’t using them (guide).

It is possible to search the MPMoviePlayerContentPreloadDidFinishNotification via terminal if you call
grep -Rnis ‘MPMoviePlayerContentPreloadDidFinishNotification’ *
in your project folder

and you can verify your .ipa’s Payload with
nm -u xyz | grep MPMoviePlayerContentPreloadDidFinishNotification
where xyz is binary inside your payload folder. You can extract the payload from you .ipa by extracting with any .zip compatible tool.

If the binary contains MPMoviePlayerContentPreloadDidFinishNotification then terminal will print
_MPMoviePlayerContentPreloadDidFinishNotification

2 Likes

I just got this same error attempting to submit an app just now. Do I understand correctly that it will be impossible to even have a binary upload accepted until Apple fixes this?

I’m still on Unity 3.5, as it happens, but it doesn’t seem to be related to that.

Thanks for pointing that out, I didn’t realize I still have any Flurry code in my project; I’m not using it anymore, but at one point a whiiiiiiile ago I had briefly installed Flurry to test.

I’ve run into this problem on a project completely unrelated to Unity; I have a video player library that inherits from MPMoviePlayerController. That’s for sure where the issue lies; hopefully Apple fixes it soon.

I believe it’s possible to make an appeal to have a project accepted despite validation errors if you have a good case, but I’m not 100% how to go about doing it.

I submitted my last build, finally.

On the one hand, as I pointed out in an edit to the first post, I did find MPMediaPlaybackIsPreparedToPlayDidChangeNotification in their documentation so I think the error saying it was non-public is wrong. Apple may have had a goof up with recently released updates surrounding ios 8 that are fixed by now.

On the other hand, I did find there were still some traces of Flurry in my project so I deleted those, to remove all references to MPMediaPlaybackIsPreparedToPlayDidChangeNotification

For Unity 3.5 users I have manual patch to work around this problem. You can download it here: http://files.unity3d.com/mantas/3.5/libiPhone-lib.a.zip
Note: you can apply this patch only for Unity 3.5.7f6, applying it on any other version will cause crashes.
Instructions how to apply:

  1. Locate where your Unity 3.5.7f6 is installed
  2. Navigate here to the Unity.app/Contents/PlaybackEngines/iPhonePlayer/iPhone-Trampoline/Libraries subfolder (use Terminal.app or 'Show package contents feature in Finder)
  3. Overwrite existing libiPhonei-lib.a with the one coming from this zip.
  4. Rebuild your application, test video playback carefully and retry App Store submission with the new build.

Please let me know if it helped you

3 Likes

Thanks Mantas! I was pretty convinced we would never be able to submit to iOS again with Unity 3!, but this fix works great. I made the mistake of doing the update, then trying to resubmit from Xcode again. Since the update is for Unity, make sure to rebuild from Unity!

Yeah hopefully they fix this. I had to remove a plugin in order to get this to work, but would like to add it back in a future release.

Will this also fix this new validation warning with the setMovieControlMode: method (see attached image)? It comes from the same
MPMoviePlayerController (MPMoviePlayerDeprecated) category.

Full text of the warning:
“The app references non-public selectors in Payload/Mansion.app/Mansion: setMovieControlMode:”

1784809--113504--Screenshot 2014-09-23 18.48.21.png

A 1000 thanks, the patch worked for me :slight_smile:

I have the same problem, did you solve yet ?
I am using unity 3.5.6 upgrade to 4.x will help ?

I am using unity 3.5.6 upgrade to 4.x will help ?

Unity 4.5 has no troubles with that.

I’m currently getting this error with Unity 4.5.5 and XCode 6.1. Not using any third party plugins.

I’m also getting similar error with Unity 4.5.4 and 4.5.5 with xCode 6.1 on OSX 10.10.
I am not using any plugins.

I need to push an update but Apple has changed something and removing all iAd reference and GameCenter stuff didn’t fix anything.

Error i’m getting: “Your app contains non-public API usage

Hi everybody,

I have the same error for me. I want to update my game (it was release last june) but I can’t.

I’m using : Unity 4.5.4f1 + XCode6.1 + OSX 10.9.5

Edit : Trying with Unity 4.5.5f1 but the problem still the same.

Sounds like it is Xcode 6.1 issue. People are reporting that downgrading to Xcode 6.0.1 helps.
http://stackoverflow.com/questions/26476776/non-public-selectors-in-app