Mr. Riley was a fan favorite on The Voice, and was being coached by Pharrell Williams. After winning his first battle round, he told producers he was struggling with substance abuse and returned to Philadelphia to enter rehab.
In March, after his departure was revealed on the show, he told The Inquirer, "it's tough, because everyone's just finding out and I've been moving forward." By then, he said, he had completed the rehabilitation program and was working on an album.
"He'd had his problems recently. But at the heart of all that was a very kind, gentle person," said Robby Parsons, a fellow musician who met Mr. Riley years ago when they both performed in Suburban Station.
In 2007, Mr. Riley made national headlines after being charged with disorderly conduct for singing in Rittenhouse Square. The charges were dropped and he was later awarded $27,500 in a lawsuit against the city.
In 2014, Philadelphia Magazine named him the city's best street performer.
The Voice was Mr. Riley's big break, and in the blind-audition episode that aired in February he became the fastest contestant ever to have all four judges fighting over him. He chose to work with Williams, who called his rendition of a James Brown hit "electric."
Mr. Riley said the stress and long hours of the competition had been "more responsibility than I could handle," but added that the show was "a really great source of support."
While the show cited only "personal reasons," Mr. Riley said he decided to disclose his substance abuse to clear up rumors about his reason for leaving, and to dispute a tweet his former manager sent out on Mr. Riley's account that supported Mumia Abu-Jamal, convicted of gunning down a Philadelphia police officer in 1981.
The manager later said Mr. Riley had nothing to do with the tweet.
Mr. Riley said he was raised by his grandmother in West Philadelphia. When he was 19, his stepmother died and his father, a SEPTA conductor, encouraged him to start singing in Suburban Station, according to a biography on his website.
In an Inquirer profile from 2010, when Mr. Riley was auditioning for Fox's American Idol, he said Philadelphia's tough crowds steeled him for the harsh music business, and a stint in Vegas helped him evolve from a singer into a complete entertainer.
When he made it to prime time this year, Mr. Riley gave the impression of a born performer, with his easy smile, smooth but powerful voice, and jazzy footwork.
Parsons said the charm was authentic.
"He smiled and he meant it," Parsons said, likening Mr. Riley to comedian Robin Williams, who "made so many people happy, but didn't know how to make himself happy."
Halima Miley, Mr. Riley's older sister, said that the family had yet to make arrangements but that a memorial would be open to the public.
"The city was his family. Everybody knew him, he couldn't walk two steps without someone saying, 'Anthony, how you doin'?' " she said. "The public loved him."
Anyone struggling with thoughts of suicide is urged to call the 24-hour Suicide Prevention Lifeline at 1-800-273-TALK, or visit www.suicidepreventionlifeline.org.
Inquirer staff writer Sofiya Ballin and Philly.com's Nick Vadala contributed to this article.