Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Bug Unity Apple plugin Issue

Discussion in 'iOS and tvOS' started by Telesto26, Jul 19, 2023.

  1. Telesto26

    Telesto26

    Joined:
    Dec 31, 2020
    Posts:
    13
    We are upgrading our ObjC-based iOS multiplayer game to Unity, so we plan to use the Unity Apple plugins. Specifically, we want to use Apple.Core and Apple.Gamekit packages.

    1. Cloned the project from https://github.com/apple/unityplugins
    2. Built the package using Unity 2020.3.33f1
    3. In the Unity Editor, used Windows > Package Manager and added both packages from the tarball.
    4. No errors; all looks good.
    5, Built & Run the project and installed the game on an iPhone 13 device. 6. Once the game starts, we see the following errors, and the game quits.

    Errors: '/private/preboot/Cryptexes/OS/usr/lib/swift/AppleCoreNative.framework/AppleCoreNative' (no such file), '/private/var/containers/Bundle/Application/0CF8E689-36C1-4AA6-9CF6-1E078EC1A3FB/Game.app/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file), '/private/var/containers/Bundle/Application/0CF8E689-36C1-4AA6-9CF6-1E078EC1A3FB/Game.app/Frameworks/UnityFramework.framework/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file), '/private/var/containers/Bundle/Application/0CF8E689-36C1-4AA6-9CF6-1E078EC1A3FB/Game.app/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file), '/System/Library/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file, not in dyld cache)

    Anyone, please help us to resolve the above issue?
     
    yusuf_isik likes this.
  2. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    302
  3. Telesto26

    Telesto26

    Joined:
    Dec 31, 2020
    Posts:
    13
  4. nicholas_2411

    nicholas_2411

    Joined:
    Jan 22, 2019
    Posts:
    3
    struggling with same issue for a few days now , i have no idea what to do , tried a bunch of "solutions"
     
  5. nicholas_2411

    nicholas_2411

    Joined:
    Jan 22, 2019
    Posts:
    3
    CloudOnce is a package that worked for me but it stopped working after a while
     
  6. Telesto26

    Telesto26

    Joined:
    Dec 31, 2020
    Posts:
    13
    Does anyone know who is the owner of the Unity Apple Plugin? I guess it is not Apple or Unity!
     
  7. yusuf_isik

    yusuf_isik

    Joined:
    Feb 14, 2014
    Posts:
    21
    I have the same issue. Until the game starts everything is perfect. But when I try to start my game, it crashes directly. And shows the same errors.

    My scenario:
    Unity 2022.3.7.f1
    XCode 14.3.1
    com.apple.unityplugin.core-1.0.3
    com.apple.unityplugin.gamekit-1.0.4

    As an addition to the topic, I have noticed extra information about the problem. After I get the Unity iOS build, I see these logs on Unity Console:
    1. AppleBuild: OnProcessFrameworks begin...
    2. AppleBuild: OnProcessFrameworks for step: AppleCoreBuildStep
    3. Failed to locate path for library: AppleCoreNative.framework
    4. AppleBuild: OnProcessFrameworks for step: AppleGameKitBuildStep
    5. Failed to locate path for library: GameKitWrapper.framework
    6. AppleBuild: OnProcessFrameworks for step: AppleSecurityBuildStep
    7. AppleBuild: OnProcessFrameworks end.
    The main issue here is that 3rd and 5th steps are logged as a normal Debug.Log(). So as a regular development process, we don't see info logs. These logs should be red, I mean they should be Debug.LogError(). But it is not.

    To Sum up, probably something is wrong with the packages. But I'm not familiar with XCode and iOS development. I don't know what should I fix in these packages. If anyone has an idea, I would appreciate it.
     
  8. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    302
    You cannot even build for macOS. And on 2023 for iOS with murrazi’s fetch local items branc fix, it still fails. Its a mess and Unity/Apple don’t seem to be anywhere to fix it :(
     
  9. yusuf_isik

    yusuf_isik

    Joined:
    Feb 14, 2014
    Posts:
    21
    Hello everyone. We have a solution for the error that "Failed to locate path for library: AppleCoreNative.framework" in Unity Editor.

    Please make changes on your AppleFrameworkUtility.cs script's "GetPluginLibraryPathForBuildTarget" method like the link:
    https://github.com/makeplayhappy/ap...ts/Apple.Core/Editor/AppleFrameworkUtility.cs

    The problem was the AssetDatabase.FindAssets(). The method was not founding the *.framework folder. It solves the missing file error and the launch crash. But it is still freezing on the login on my usage scenario. Maybe I'm using it wrong. If I detect the problem, I will inform you.
     
    Last edited: Sep 4, 2023
  10. pixelsprite_unity

    pixelsprite_unity

    Unity Technologies

    Joined:
    Sep 22, 2022
    Posts:
    15
    Hi folks, the plugins mentioned here https://github.com/apple/unityplugins are owned, developed, and maintained by Apple. Unity is not the owner - please give Apple feedback here & repro steps so that they can update.
     
  11. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    757
    The issue has been brought up and supposedly Apple knows about it, but it has been about half a year without a response or fix: https://forum.unity.com/threads/gklocalplayer-local-fetchitems-error-on-unity.1395694/#post-8814625

    I am just wondering since Authentication is a paid service (of course there is a free tier), how this is acceptable?

    Also, Social API is being depreciated. Is that plugin the new way to access leaderboards and achievements in iOS? If so, how long will it take for bugs to be fixed? It seems like we have to wait 6+ months so far. From what I have seen, its impossible to use that with macOS and iOS on any version of Unity I have tested (2022 and 2023)

    https://docs.unity3d.com/2023.3/Documentation/Manual/net-SocialAPI.html

    Thanks!
     
    nicholas_2411 likes this.
  12. yusuf_isik

    yusuf_isik

    Joined:
    Feb 14, 2014
    Posts:
    21
    I found the problem. @MousePods is right. The fetchItems method is crashing. This means there is no easy fix. We need to learn how to create native plugins with Unity to solve the problem. Not cool :(

    @pixelsprite_unity you are right. However, the Unity forum is the best place to discuss the situation. There are lots of experienced developers here. Some of them may solve the problem without waiting for the Apple folks. If someone searches for the same problem as us on Google, probably they will find this topic on Google. I think this is the best place for the discussion about the bugs. And also we need a solution for the Apple GameCenter authentication. Because when we want to use a 3rd party authentication service, they require salt and signature information. The Unity Social API does not have a built-in method for this information.

    Social API will be depreciated. Apple Gamekit plugin is not working in its current status. This means if Apple does not fix the Gamekit plugin, there will not be an easy solution for the game center authentication. This is a really important problem. Nowadays, game center and play games authentication are like mandatory for mobile games.

    To Sum up, I'm going to learn how to develop native plugins with Unity. Wish me luck. Cheers everyone :rolleyes:
     
    qball13z, nicholas_2411 and MousePods like this.
  13. pixelsprite_unity

    pixelsprite_unity

    Unity Technologies

    Joined:
    Sep 22, 2022
    Posts:
    15
    Thank you @MousePods and @yusuf_isik for the extra context. I have reached out to the Authentication team to find out more about the issue raised with Apple.

    @yusuf_isik I agree it's important to share information here. My initial comment was not against that. I was clarifying to previous posts questioning who owns the particular plugin. Thank you for suggesting a way to unblock people.
     
    qball13z, yusuf_isik and MousePods like this.