Search Unity

Game get rejected by Non-public API usage.

Discussion in 'iOS and tvOS' started by Hung183, Jul 10, 2019.

Thread Status:
Not open for further replies.
  1. Hung183

    Hung183

    Joined:
    Jan 16, 2016
    Posts:
    19
    Apple review my game and reply my game have a issuse:

    ITMS-90338: Non-public API usage
    - The app references non-public symbols in My Game: _curl_easy_cleanup, _curl_easy_init, _curl_easy_perform, _curl_easy_setopt, _curl_slist_append, _curl_slist_free_all. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed

    How can i fix it ? Thank.

    I use Unity 5.3.4, Xcode 10.2.1 and UnityAds.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I might suggest that if method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. Did you check?
     
    Last edited: Jul 9, 2020
  3. ydolf001

    ydolf001

    Joined:
    Jul 3, 2019
    Posts:
    3
    I have the same problem with Unity5.3.4,
    Did you solved it?
    Thank.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You also have the error that includes the text _curl_easy_cleanup, etc?
     
  5. ydolf001

    ydolf001

    Joined:
    Jul 3, 2019
    Posts:
    3
    Yes,the error is:
    ITMS-90338: Non-public API usage - The app references non-public symbols XXX: _curl_easy_cleanup, _curl_easy_init, _curl_easy_perform, _curl_easy_setopt, _curl_slist_append, _curl_slist_free_all. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/
     
  6. NicTda

    NicTda

    Joined:
    Jan 11, 2018
    Posts:
    19
    Unearthing this thread as I couldn't find any working solution.

    I've encountered this issue, using Unity 2019.3.12f1 on macOS Catalina 10.15.4

    ITMS-90338: Non-public API usage - The app references non-public symbols in Frameworks/UnityFramework.framework/UnityFramework: _pb_decode, _pb_decode_varint, _pb_encode, _pb_encode_string, _pb_encode_submessage, _pb_encode_tag_for_field, _pb_encode_varint, _pb_istream_from_buffer, _pb_ostream_from_buffer, _pb_read. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/

    Anyone seen this with this version of Unity?
     
  7. tcvpromo

    tcvpromo

    Joined:
    Jun 7, 2017
    Posts:
    25
    We have the same issue..... Does anyone know how to solve this problem?
     
  8. NicTda

    NicTda

    Joined:
    Jan 11, 2018
    Posts:
    19
  9. yoanf

    yoanf

    Joined:
    Dec 21, 2015
    Posts:
    2
    Hello,
    I'm having the same issue here trying to update a game we made with 5.3.4. otherwise Apple will remove it from the store un June :(
    Apple store rejects it for all the curl non public symbols.
    Did you guys find any solution? (I can not upgrade unity project)
    So to narrow down the problem, did you use any external asset/plugin?
    I use Stan assets, Ultimate mobile
     
  10. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    516
    Are you guys using any third party plugins? I would recommend start with and empty project, and pull in the suspecting plugins and code one at a time.

    @NicTda I noticed that there has been a similar issue reported in Firebase's GitHub. Maybe it's your situation? https://github.com/firebase/firebase-ios-sdk/issues/4338
     
  11. yoanf

    yoanf

    Joined:
    Dec 21, 2015
    Posts:
    2
    I removed all of them except Unity Purchasing who is used for the in App purchases, and still got the error.
    How can I identify who's the guilty file?
    This general post suggests that it could be related to Debug/Release inclusions:
    https://forums.developer.apple.com/thread/127678
     
  12. sbethge

    sbethge

    Joined:
    Mar 20, 2019
    Posts:
    16
    We had the same issue with different methods that we had in a custom native plugin (which will be part of the UnityFramework target in Xcode). Try searching your whole code base and also the generated project in xcode for the non-public method calls to find which code or 3rd party plugins are the cause.
     
  13. troshchuk

    troshchuk

    Joined:
    Jan 17, 2017
    Posts:
    2
    I have the same issue for Unity 2019.4.5f1. Do you have any updates how to fix it?
     
  14. NicTda

    NicTda

    Joined:
    Jan 11, 2018
    Posts:
    19
    I'm now using Unity 2019.4.4f1 and I'm not getting this error anymore, although I had to remove the Facebook SDK to have a working build. Not sure if that was this error I was getting, or if it would even compile with it.
     
  15. Cery_

    Cery_

    Joined:
    Aug 17, 2012
    Posts:
    48
    I ran into the same issue and didn't find any good info how to debug/troubleshoot/fix this. After a few days of tiring debugging i was able to resolve this. Here is my experiences, maybe its of help to someone:

    "The app references non-public symbols" means that the UnityFramework uses symbols that are also used by some private Apple APIs and get rejected for that reason.
    To my understanding the UnityFramework is basically a dynamic library build consisting of your code converted from c# to cpp by i.e. il2cpp. In addition to your code it can also include the pods and other resources necessary to build.

    When building, the result is an App that contains the UnityFramework and the others. Even for iOS its just a packaged app with the respective contents. When archiving with xcode the archive can be investigated (or directly the build products). Dissecting the packages reveals the built UnityFramework. (i.e. at your.app/Frameworks/UnityFramework.framework/UnityFramework)
    Running "nm -a" on that binary dylib reveals the used symbols in that. If the Non-Public Api error references a different binary check that one.
    The symbols should contain the problematic symbols that apple complains about. In my case it was:
    U __ZN3icu5Edits10addReplaceEii
    U __ZN3icu5Edits12addUnchangedEi
    The U shows that these are undefined. Which is the culprit i think.
    In this case i was able to derive the origin of the symbols from the name. "ZN3icu5Edits10addReplaceEii" seems to originate from ICU a component library for unicode and the namespace Edits with the function addReplace.

    From this I was able to track down the trace to the linker include flags on the UnityFramework build target in xcode. In my case FirebaseDatabase added "-licucore" to the other linker flags by changing the .xconfig files in the "Pods/Target Support Files" directory of the xcode project.

    Removing all traces of that flag from the .xconfig files (multiple) removed the flag from the build process. To my surprise it build and runs without errors or crashes (so far...).

    Checking the binary afterwards shows that the symbols are now marked "T" and i think that means they are public in the code section of the dylib and no longer clash with the private apple apis.

    After that I was able to release to the Appstore Connect.
     
    maxuntoldgarden likes this.
  16. maxuntoldgarden

    maxuntoldgarden

    Joined:
    Dec 9, 2019
    Posts:
    7

    Thank you so much for this! I've been looking for a solution for a while and didn't know how to trace the source of the issue.
    So far, our app is working as well
     
  17. Doraemon231

    Doraemon231

    Joined:
    Dec 18, 2018
    Posts:
    22
    Are you talking about removing -l”icucore” from other linker flags? Can you give a more concise and precise explanation?
     
    Last edited: Feb 10, 2023
  18. Cery_

    Cery_

    Joined:
    Aug 17, 2012
    Posts:
    48
    I think this might differ from setup to setup. In my case it was icucore which i could derive from "__ZN3icu5Edits10addReplaceEii".
    Which would show up as -l”icucore” in the other linker flags. It might be possible to just remove it from there (Unity-iPhone + UnityFramework).
    What i did is remove it from the "Pods/Target Support Files/Pods-UnityFramework/Pods-UnityFramework.release.xcconfig" and "Pods/Target Support Files/Pods-Unity-iPhone/Pods-Unity-iPhone.release.xcconfig". Which I think has the same effect.

    If your error references a different non public api I would suggest you do the "nm -a" method as described above to find the library that causes the issue.
     
    Doraemon231 likes this.
Thread Status:
Not open for further replies.