So.. AC comes on fine. Cruise control works fine, but cruise truns off when AC is turned on.
When you have the cruise control on, and then turn on the AC system, the ECU wants to raise the RPM of the engine to keep the vehicle at the set MPH because the AC system creates a drag on the RPM of the motor.
There is an input or sensor not giving input or proper input to the ECU, so it shuts the cruise control off. It may be a revolution sensor on the transmission or speed sensor on one of the wheels giving intermittent input. This will require a lot of troubleshooting.
Is there a check engine light on as well?
Can you have AC on and then engage the Cruise later?