Did you know that Odysseus had a sort of treehouse???
Odysseus, known also as Ulysses, the hero of Homer’s epic poem the Odyssey (800 a.C. / 700 a.C.), built his own house around his marriage-bed, that has been caved in a centenary olive tree. And this was the key for Penelope (Odysseus’s wife) to recognize him when he returned home after years.
“When Odysseus has bathed, Penelope, still aloof, tests him by suggesting that his bed be moved. Odysseus, however, knows the bed he built is immovable for he constructed it around an olive tree which serves as a bedpost. Thus, Penelope recognizes and accepts her husband”.
So I guess this is the first example in literature of a treehouse, if you know others more ancient, please write me!