We analyze simple models of gauge mediated supersymmetry breaking in the context of supergravity. We distinguish two cases. One is when the messenger of the supersymmetry breaking is a non Abelian gauge force and the other is when the messenger is a pseudoanomalous U(1). We assume that these models originate from string theory and we impose the constraint of the vanishing of the cosmological constant. In the first case, we do not find vacua that are consistent with the constraints of gauge mediation and have a zero tree level cosmological constant. In the second case, no such conflict arises. In addition, by looking at the one loop cosmological constant, we show that the dilaton F-term can not be neglected in either case.