Solution deposition method for forming metal oxide or metal hydroxide layer