Individual fitness is expected to benefit from earlier maturation at a larger body size and higher body condition. However, poor nutritional quality or high prevalence of disease make this difficult because individuals either cannot acquire sufficient resources or must divert resources to other fitness-related traits such as immunity. Under such conditions, individuals are expected to mature later at a smaller body size and in poorer body condition. Moreover, the juvenile environment can also produce longer-term effects on adult fitness by causing shifts in resource allocation strategies that could alter investment in immune function and affect adult lifespan. We manipulated diet quality and immune status of juvenile Texas field crickets, Gryllus texensis, to investigate how poor developmental conditions affect sex-specific investment in fitness-related traits. As predicted, a poor juvenile diet was related to smaller mass and body size at eclosion in both sexes. However, our results also reveal sexually dimorphic responses to different facets of the rearing environment: female life history decisions are affected more by diet quality, whereas males are affected more by immune status. We suggest that females respond to decreased nutritional income because this threatens their ability to achieve a large adult body size, whereas male fitness is more dependent on reaching adulthood and so they invest in immunity and survival to eclosion.