Apple Core Haptics Unity Errors In Xcode - How Do I Fix Them

187 Views Asked by At

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.

0

There are 0 best solutions below