How do I attach a motion activated flood light to stucco?
I would not recommend gluing it.  If it comes off (wind, animal), it is going to likely pull the stucco off with it in which case you have a big problem and possibly costly repair.

I would just use the screws since it is easier to fill two small holes then fix a large patch of stucco.  Make sure to use screws long enough to penetrate the solid material behind it; at least 1 1/2" wood screws.