Jackson Odell -- the former teen actor and songwriter who died on Friday -- had a history of heroin use, but he was clean when he last underwent a drug test ... TMZ has learned.
Law enforcement sources tell TMZ ... Jackson had been at a sober living home for about 3 weeks when he was found unresponsive. We have also learned there were no drugs or drug paraphernalia found when his body was discovered.
TMZ broke the story ... Jackson -- best known for his role as Ari Caldwell on "The Goldbergs" -- died in the San Fernando Valley. As we reported ... no foul play was suspected. An autopsy and toxicology testing is underway to determine the cause of death.