I have had numerous rock flowers and numerous emeralds. They never crossed paths. Unless that rock flower is dying and the crab is just getting a head start, I would evict that crab. He's bound to attack other things too.
I had one emerald that managed to fish hook my diamondback goby's mouth and hold tight. The emerald would not let go until I stuck my hand in the tank and became a bigger threat than the emerald's diamondback bounty. He let go. Even this emerald never bothered any of my rock flowers.