A solid is that which has length, breadth, and depth.
This sentence recognizes that there are three dimensions in the world, and it was written in 300 BC. Are there any known earlier references to 3 spatial dimensions?
This is much more "obvious". It may well be even pre-historic. But since the question asks for written evidence:
If you want mathematics, go like an Egyptian or Mesopotamian:
A rectangular prism-grain silo has a volume of 2500 quadruple heqats. Describe its three dimensions l1, l2, l3 in terms of cubits.
From Rhind-Papyrus (It dates to around 1550 BC –– Problem 46)
If you see that the Akkadians standardised for their constructions the bricks they used, it should be clear that 3 dimensions are needed for such a standard. The obsession of Sumerians, Akkadians, Babylonians for metrology and calculations of volumes speaks, the same.
Although the standardisation of bricks was first done in the Indus valley civilisation of Mohenjo-Daro:
The bricks used for the building of houses in Mohenjodaro and Harappa are well burnt and of excellent proportions, which have excited the admiration of modern engineers in Sind. […] At no other period has the Indian builder ever struck upon this most business-like size of bricks, and it is remarkable that the evolution of bricks in the historic period fom Asoka commences with bricks of about double the length and breadth of the Indus Valley brick. It gradually diminishes from the Kushana, Gupta and medieval periods, but never attains the true proportion of length, breadth and thickness as 1 : 1/2 : 1/4, which makes for an excellent bond. That this ideal proportion was not entirely forgotten is shown by the fact that a later text (Kasyapa Samhita) prescribes a proportion of 10 fingers of length to 5 fingers of width and half of the latter for thickness; but it is doubtful whether in actual practice the masons ever followed this in the historic period.
Rao Bahadur K. N. Dikshit: "Prehistoric Civilization of the Indus Valley, Sir William Meyer Lectures, 1935", Indus Publicaitons: Karachi, 1939, p 15.
The bricks found are from ~3000BCE, the text mentioned describing them is the Kashyapa Samhita, dated to 600BCE.
Some clay tablets from Iraq are classified as calculating in this direction, e.g.:
Note: Ist L 9395 and Ist L 9404, catalogued as 'mesures de longeur' and 'mesures a trois dimensions' (Genouilac 1921,37) but not yet published, may also bear problems of types (c)/(d) and (e) respectively (Foster 1982c, 239).
Very roughly a third of the extant corpus of mathematical word problems concern two- or three-dimensional figures in some way, and some 150 problems or rough calculations (from across the whole of the cuneiform timeframe) are ilustrated by geometrical diagrams. This interelationship between the visual, the textual, and the numerical is particularly rich.
Eleanor Robson: "Mathematics in Ancient Iraq. A Social History", Princeton University Press: Princeton, Oyford, 2008m p 304; p45. Page 45 From the chapter "Before the Third Millenium"
The Bible verse Genesis 6:15 quantifies the three dimensions of Noah's Ark, at 300, 50, and 30 cubits. Some scholars have estimated the Book of Genesis as being written between 500 and 1000 BC.