This article from the Washington Post refers to the US' war in Afghanistan as its longest. Others have said the same. As of 2018 it's been about 17 years. The headline says longest foreign, but the article says longest without the foreign qualifier. Other articles lack this disclarity, but refer to the war in Afghanistan only as "Americ's longest war." A Daily Signal article and an article in the Business Insider are among articles listed in a Google search that refer to the war in this way.
The Chicamauga Wars lasted about 19 years. The Texas-Indian Wars lasted about 55. The Yaqui Wars about 22. The Apache Wars about 49. The Occupation of Nicaragua about 21. The Occupation of Haiti about 19. The Laotian Civil War about 22.
Is it because they're domestic? Or because the others are considered "wars" and not each a "war," singular? Or because they were minor and aren't counted? Not all of the other wars satisfy the first two criteria.