Insufficient system permissions when setting product info in Flutter app

I’m getting an exception: “Insufficient system permissions.”, when initializing the LexActivator library in a Flutter app, running on Mac OS, and I’m not sure why. Is there some permission I need to allow/grant in XCode?

void _initializeLexActivator() {
  LexActivator.SetProductData(
      productData: "mylongdatastring");
  LexActivator.SetProductId(productId: "myproductid", flags: LexActivator.LA_USER);
}

void main() async {
  try {
    _initializeLexActivator();
  } on LexActivatorException catch (e) {
    print("Exception validating license");
    print(e);
  
  // ...other application-specific code
}

I tried with LexActivator.LA_SYSTEM and got the same error.

Hello @newmicro

This is likely to happen if your application does not have the correct entitlements in XCode.
Assuming your application is using App Sandbox to comply with App Store requirements, you will need to use the following permissions for LexActivator to correctly communicate with Cryptlex servers.

com.apple.security.network.server
com.apple.security.network.client

Furthermore, since LexActivator saves an activation file on your storage in the SetProductData() method, this is where you are facing “insufficient system permissions”. To ensure you do not face this issue, pass a file path where your application has write access to SetCustomDataDirectory() before calling SetProductData()

Thanks, that worked for me. The method, I think is SetDataDirectory() though. SetCustomDataDirectory() doesn’t appear to exist in my testing. I appreciate the help.