How long do I have to have a local license before I can apply for a state license?

You needed to stay in compliance and good standing with your local city ordinance until Jan 1st 2018, when California began accepting state applications.