I had this exact issue.
Solution:
I tried every single possible thing to fix this and nothing at all worked. It was maddening-- I have NO IDEA what was proventing me from just embedding a new DriverKit driver target into my app-- I tried EVERYTHING possible, including re-installing Xcode completely, with a full purge and re-load, full reload of xcode-select --install
as well.
The only thing that worked:
- Create a new application target, embed / link the new DriverKit target to the new application target
- Select every single file from the original project and add them all to the new application target using the Attribute Inspector
- After adding all source code, manually update the new target's application info.plist, entitlements, etc.
After re-making the application target, this error stopped blocking me from compiling with the DriverKit driver.
I must underline though that literally everything I could possibly check between these two targets is configured identically. It still is, and it still doesn't work with the original app target, and does with the new one. This one cost me a few hours, but tbh it seems like it is just a troll in the machine.
TL;DR: This was solved (for me) by just starting over with a new application target.
**
Local Env
- Application:
- macOS application (Cocoa / AppKit, not Catalyst)
- developed using a .xcworkspace so I can simultaneously work on a requried, private SPM Package
- application has other OSS package dependencies, all incorporated by a mix of local forks and remote branches / releases
- Macbook Pro, model Mac14,10, (M2 Pro, 16GB)
- macOS Ventura 13.5.1 (22G90)
- Xcode 15 (latest, and latest Swift version)
- macOS app target version: 12.*^