Apparently there is a slight change in the option to add a hidden Wi-Fi network in Android Pie . While adding the respective hidden wifi network you should tap the Advanced option then at the bottom you should find Hidden Network and set this to Yes. That's all.
And, thanks to @nitin kachare for reminding me about this. I got confused too at first but quick search in Google provided me with this useful info.