Shes 4 , remember ? Shes does not have the mental capacity that you would have knowing crying is not the answer to everything. Don't yell because you only make the crying worse and don't give in because she doesn't learn, you have to wean her off of crying, when she needs help teach her to ask and not get frustrated. And if she cried & cries theres discipline, time outs & naps , things 4year olds don't like. My little brother is 5 and im 10years older than him. He cries when he's upset and can't do something. My mom tells him well if you don't stop whining you won't be able to play xbox or go to karate . Because big boys don't cry. You have to be the parent but not so much the enemy at the same time.
Well, stop shouting, for one thing. Crying over things at 4 is not entirely unusual -- even if some of it is the desire to get attention, some of it will be out of her control. On the other hand, you are an adult and should not be shouting at her. You do have control of yourself.
Is the getting enough of your attention? A child who wants face time with her parent will take even negative attention, if that is all she can get. I would spend a bunch of one-on-one time with her, and see if that eases the crying reaction.