"There is a bird on the tree."
Duo's sentence as well as your 2 sentences are all correct. In most cases, Duo's would be more natural, but there are also cases where we would like to make "tree" more prominent and your sentences may become more suitable than Duo's.
My advice for people who are not certain about 的 is to use it rather than to omit it, unless you are using 2 or more of them in a row, or you know it would change the meaning of your sentence.
Chinese has no indefinite article. In Duo, if you want to get the answer right, translate indefinite article to "一(classifier)" and vice versa.
When we hear birds chirping, and do not know it is only one bird or more birds, say 有鳥; when we actually see the bird and before we see another, say 有鳥, 有一只鳥 are both fine; When we see a number of birds, say 有鳥, 有 X 只鳥, 有几只鳥, 有很多鳥.