I tried everything suggested in the Apple forums and here, and still couldn’t get it to work.
Found the solution:
Your app needs to be transferred by Xcode for the sandbox to be enabled.
Your app needs to be built and installed locally by Xcode, not downloaded from the App Store.
Obvious, right? Well, if you are working with an update to an existing application, the device will still treat it as an App Store-installed app.
So delete the app from your device. Then install the app back onto the device using Build & Run with your device tethered to your Mac. It should work now 🙂