Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

submission error with MPMoviePlayerContentPreloadDidFinishNotification

Discussion in 'iOS and tvOS' started by jhocking, Sep 8, 2014.

  1. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    806
    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 http://forum.unity3d.com/threads/ios8-xcode6-compatibility.249533/


    ADDITION4: oh goody and now another wrinkle has come up, I found that API documented here https://developer.apple.com/library...ef/doc/uid/TP40006953-CH3-DontLinkElementID_3

    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...
     
    Last edited: Sep 8, 2014
  2. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    "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.
     
    Last edited: Sep 25, 2014
  3. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    806
    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.
     
  4. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    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
     
    jhocking and Mantas-Puida like this.
  5. ddf

    ddf

    Joined:
    Jul 9, 2011
    Posts:
    54
    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.
     
  6. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    806
    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.
     
  7. Exadyne

    Exadyne

    Joined:
    Sep 11, 2014
    Posts:
    1
    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.
     
  8. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    806
    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
     
  9. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    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
     
    Maisey, alfchee and schwertfisch like this.
  10. Wiggly

    Wiggly

    Joined:
    Jun 14, 2013
    Posts:
    5
    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!
     
  11. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    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.
     
  12. Filwag

    Filwag

    Joined:
    Sep 25, 2012
    Posts:
    1
    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:"
     

    Attached Files:

  13. schwertfisch

    schwertfisch

    Joined:
    Sep 7, 2010
    Posts:
    126
    A 1000 thanks, the patch worked for me :)
     
  14. oven.xian

    oven.xian

    Joined:
    Oct 16, 2014
    Posts:
    3




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

    oven.xian

    Joined:
    Oct 16, 2014
    Posts:
    3
    I am using unity 3.5.6 upgrade to 4.x will help ?
     
  16. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Unity 4.5 has no troubles with that.
     
  17. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    210
    I'm currently getting this error with Unity 4.5.5 and XCode 6.1. Not using any third party plugins.

     
    Last edited: Oct 21, 2014
  18. awitte

    awitte

    Joined:
    Oct 21, 2014
    Posts:
    8
    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"
     
    Last edited: Oct 22, 2014
  19. Aslan85

    Aslan85

    Joined:
    Feb 24, 2014
    Posts:
    13
    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.
     
    Last edited: Oct 22, 2014
  20. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
  21. Aslan85

    Aslan85

    Joined:
    Feb 24, 2014
    Posts:
    13
    OK, it's work with the Xcode 6.0.1 !

    Thank you !
     
  22. TimDev

    TimDev

    Joined:
    Jun 25, 2015
    Posts:
    4
    I'm getting this same problem, using Unity 4.6.5, both with Xcode 6.0.1 and 6.3.2. Are there any other solutions anyone has found?
     
  23. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Could you please post detailed message of the error you are receiving?
     
  24. TimDev

    TimDev

    Joined:
    Jun 25, 2015
    Posts:
    4
    Actually on a second look it's not quite the same. My problem is with MPViewController, not MPMovieViewController. The rejection notice is below:

     
  25. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    I can't find it in Unity code base. Maybe it's coming from 3rd party plugin?
     
  26. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    806
    Several of us above (including me) found the issue went away when we removed Flurry. And I mean remove all traces; in my case, I forgot I still had bits of Flurry's code in my app because I stopped using Flurry long ago.
     
  27. TimDev

    TimDev

    Joined:
    Jun 25, 2015
    Posts:
    4
    I'll need to dig through the project to see what plugins I'm using. I know I'm not using Flurry though. I'll post back if I find out anything. Thanks!
     
  28. TimDev

    TimDev

    Joined:
    Jun 25, 2015
    Posts:
    4
    It turned out it was a plugin - iYoutube. I had wanted to play some videos inside the app, rather than using Application.OpenURL, but I could never get the plugin to work, so I deleted all the references to it. It didn't occur to me that it could still be causing problems just sitting in the project. Thanks for your help!
     
unityunity