Xcode Version: 12.4 (Used Xcode 12.5 to create encryption key as 12.4 is bugged and will not let you)
I am bundling a ML model into my app, and have encrypted ML model via Xcode 12 encryption method shown here. Model loads and works fine without encryption. After adding model encryption key and setting it as compiler flag, the model encryption/decryption works fine in a demo app, but using the same load method in my main app fails with this error message:
Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.apple.CoreML Code=0 "Unable to load model at /path_to_model/my_model.mlmodelc/ with error: failed to invoke mremap_encrypted with result = -1, error = 12"
I have tried all variations of the load method available within my swift generated model file, all produce the same result above.