He names her heir when shes like 14, and only to ensure to the high lords that his brother daemon wont be king, since has no son at the time.
Shes 35 when he dies, the king has 2 true born sons from alicent by this time (like 19 and 20 years old, and a daughter who in targ fashion, marries the first born son, and they even have 3 children of there own, 6 year old twins and a 2 year old already), nobody remembers or gives a shit about what oaths were sworn 20 years earlier because almost all of those lords have died, and their sons never swore said oath, and most importantly, unlike in the show, nobody has ever mentioned or brought up the succession in the 20+ years since because immediately after naming her heir, he marries and gets his first son with alicent.
Her assumption that her brother would supercede her in the succession is partly why she becomes bitter. The fact that nobody gives a shit about some ancient oath only she remembers fuels it as well.