Many single-stranded (ss) RNA viruses self assemble from capsid protein subunits and the nucleic acid to form an infectious virion. It is believed that the electrostatic interactions between the negatively charged RNA and the positively charged viral capsid proteins drive the encapsidation, although there is growing evidence that the sequence of the viral RNA also plays a role in packaging. In particular the sequence will determine the possible secondary structures that the ssRNA will take in solution. In this work, we use a mean field theory to investigate how the secondary structure of the RNA combined with electrostatic interactions affects the efficiency of assembly and stability of the assembled virions. We show that the secondary stru...