Barking up the wrong tree
Barking up the wrong tree : Phrases
Making a mistake or a false assumption in something you are trying to achieve.
The allusion is to hunting dogs barking at the bottom of trees where they mistakenly think their quarry is hiding.
The earliest known printed citation is inmJames Kirke Paulding's Westward Ho!, 1832:
The phrase must have caught on in the USA quickly after Hall's book. It appeared in several American newspapers throughout the 1830s. For example, this piece from the Gettysburg newspaper The Adams Sentinel, March 1834: