I am trying to advertise in NEXUS 9 and getting the error of ADVERTISE_FAILED_DATA_TOO_LARGE. It was working perfectly fine when I was adding the service after successfully
You can either change your device's name to something shorter. Example: XYZ_Name_pic - > XYZ
Go to bluetooth -> settings - > rename device name
or you can pass false instead of true
advertiseData.setIncludeDeviceName(false); // pass false not true