2. Barking up the wrong tree
Today it means to make a mistake or a false assumption in something that you are trying to achieve.
In the past, it goes back to at least the early 19th century, back when hunting was a big sport where dogs chased another animal up a tree. However, because they are not good climbers, they remained at the bottom and barked up the tree instead. The barking informed the human hunters of the fleeing animal's location, making his job a whole lot easier. Of course, sometimes, even dogs can make mistakes barking up the wrong tree.