The Indian Avalokitesvara is male. The Chinese Guanyin, for most of the last thousand years, is female. That change is one of the best-documented transformations of a religious figure anywhere, and it also carries claims repeated more confidently than the evidence allows.
What is established. Avalokitesvara is masculine throughout Indian Buddhism, in the Sanskrit sources and in the iconography at Gandhara and Ajanta. Chinese representations before the Song dynasty, which began in 960, are masculine in appearance. From roughly the twelfth century the female depiction becomes dominant in China and remains so.
Whose argument this is. The standard treatment is Chun-fang Yu, Kuan-yin: The Chinese Transformation of Avalokitesvara, Columbia University Press, 2001. Yu treats the change as indigenization of Buddhism in China: a Chinese process working on an Indian figure. Anyone claiming the shift began in India is disagreeing with the standard account and needs to say so.
Where the raw material came from. The thirty-three manifestations of Lotus Sutra chapter twenty-five, which include female forms, are Indian and scriptural and supplied the warrant. But they are forms taken temporarily for a purpose, not a statement about the bodhisattva's identity, and the Chinese development made an occasional form the standing one.
Indigenous Chinese material. The Miaoshan legend, in which Guanyin is a princess defying a cruel father, is carried in the Precious Scroll of Fragrant Mountain, a Chinese scripture with no Indian original, and is traced to Jiang Zhiqi in the eleventh century at Xiangshan. The standard monograph is Glen Dudbridge, The Legend of Miao-shan, 1978.
What is not stated here. No dated image is offered as the earliest female depiction; the sources support century-level claims only. And no female Avalokitesvara is attested in India.