ABSTRACT Planet formation and photoevaporation have both been considered as gap opening mechanisms in protoplanetary disks. We have studied giant planet formation in a photoevaporating disk with long-term evolution. Our calculations suggest that the core accretion rate of a protoplanet declines and the trigger of the runaway gas accretion for a giant planet is delayed under the action of photoevaporation. We find that the final mass of a giant planet characterized by the “gap-limiting” case is not influenced by photoevaporation but the final mass of a giant planet characterized by the “diffusion-limiting” case is greatly influenced by photoevaporation. Considering the formation process of giant planets, we suggest that the locations of the gaps opened by giant planets are within 30–40 au and the gap width in the “gap-limiting” case is wider than that in the “diffusion-limiting” case. We also find that gaps in photoevaporating disks are wider than those in non-photoevaporating disks. Our calculations suggest that the origins of multiple gaps in a disk can be diverse depending on their formation locations. In the formation region of giant planets, gaps are opened by giant planets. The outer gap beyond the giant planet formation region may be opened under the action of photoevaporation. A gap may also be opened at 1–3 au under the actions of photoevaporating dissipation and gas accretion of the outer giant planets.