We fabricated a perovskite solar cell that uses a double layer of mesoporous TiO2 and ZrO2 as a scaffold infiltrated with perovskite and does not require a hole-conducting layer. The perovskite was produced by drop-casting a solution of PbI2, methylammonium (MA) iodide, and 5-ammoniumvaleric acid (5-AVA) iodide through a porous carbon film. The 5-AVA templating created mixed-cation perovskite (5-AVA)(x)(MA)(1-x)PbI3 crystals with lower defect concentration and better pore filling as well as more complete contact with the TiO2 scaffold, resulting in a longer exciton lifetime and a higher quantum yield for photoinduced charge separation as compared to MAPbI(3). The cell achieved a certified power conversion efficiency of 12.8% and was stable for >1000 hours in ambient air under full sunlight.