In the present Communication we discuss a field-induced and photoinduced self-doping chemistry resulting in the formation of the positively and negatively charged vacancies in the MAPbI3 perovskite films. These vacancies induce p-type and n-type doping of the perovskite absorber leading to the realization of the p-i-n device operation mechanism.