I am experiencing the same issue - lower rib muscle cramp. It started when I played for 3 hrs straight on a sunny 30c afternoon. & I didn't wait an hr after lunch.
Anyways, I waited a week w/o tennis or any exercise to let it go away. Now, I'm having the same problem with my right side after a day of backhand drill.
I imagine it's b/c mild-overexercise & switching to open stance. My body hasn't adapted and my form isn't perfect yet.
So, my suggestion is take it easy when playing and stop when the cramp / pain is too much.
You don't wanna suffer any serious / long term injury and has to wait out for months or more.