0

Error Screenshot

I am trying to get the Apple Core Haptics plug-in to work with Unity but am having issues when I try to build the project.

I created a completely blank project with just the Core and CoreHaptics plug-ins installed. I then put in a single script which is a replication of the script shared in the WWDC22 video on this subject.

Then when I try to build and run that project I get a series of “Undefined symbol:” errors in Xcode. These effect the CoreHaptics, UIFeedbackGenerator frameworks.

If I remove the script and just build an empty project with Core and CoreHaptics installed the build runs successfully. What am I doing wrong or missing that is causing these errors?

using Apple.CoreHaptics;
using System.Collections;
using UnityEngine;

    public class Haptics : MonoBehaviour
    {
        private CHHapticEngine _hapticEngine;
        private CHHapticPatternPlayer _hapticPlayer;
        [SerializeField] private AHAPAsset _hapticAsset;

        private void PrepareHaptics()
        {
            _hapticEngine = new CHHapticEngine();
            _hapticEngine.Start();
            _hapticPlayer = _hapticEngine.MakePlayer(_hapticAsset.GetPattern());
        }
        private void Play()
        {
        _hapticPlayer.Start();
    }
}

I have recreated a program from scratch with just the Apple Core and Apple Core Haptics plugins. I've built the project without any scripts attached and it builds correctly but whenever I try to build with any usage of Unity Core my Xcode build fails.

I've uninstalled and re-installed Xcode which has not changed anything.

I've also tried to build the sample "HapticRicochet" project that comes with the CoreHaptics plugin and that fails in the same way.

jnl1565
  • 1
  • 2
  • Did you add the Core Haptics Framework to your Xcode project? – Retired Ninja Mar 12 '23 at 02:23
  • 1
    I thought I did but it seems like they didn't get added correctly. I fixed that and it appears to be working now. – jnl1565 Mar 12 '23 at 02:51
  • Hi, how did you make sure the framework was added correctly? I have it in the Framework and Libraries list on the general tab of the UnityFramework target as well as the Link Binary With Libraries list in the Build Phases tab. Am i missing something else, as i still get the list of undefined symbols when building? – Adam Sutcliffe Jun 23 '23 at 12:23

0 Answers0