I'm trying to figure out what is the earliest mention of shield technology in any work of fiction to feature spaceships that are protected by shields or any similar force field technology (think of shields in Star Trek or Star Wars).
John Mastin's Through the Sun in an Airship (1909) mentioned in an earlier comment, has a protective shield. The novel is available at HathiTrust.
... he housed the Regina in her shed with all the fittings intact, also placing around it the well-known protective current of de-atomising force. (p. 21-22)
And here is an example of what the 'protective current' does:
Evidently forgetting the current was still on, he impulsively jumped on the ladder and that instant he was annihilated, even before the cry of warning could form itself on Meredith's lips.
Every one round the great doorway saw him, in the twinkling of an eyelid, de-atomise into vapour and vanish. Not a trace of him was left; he was completely volatilised. (p. 21.)
And touching the ship is not necessary:
Until the annihilating force can be cut off, any thing or person brought within twelve inches of any part of the vessel's surface or projections is volatilised. (p. 24.)
In reference to the novel's title, the field did not protect against the heat of the sun; another means was used for that.
As far as I remember, there were space ship mounted force fields, or energy barriers, or force screens, or force shields, or whatever the precise terminology, in E.E. Smith's Skylark Three, the second novel in the Skylark series. It was published in Amazing Stories in the issues date August, september, and October, 1930.
Even though Smith's heroes invented an impenetrable force barrier near the beginning of Skylark Three, they found a way to use that defense as an offensive weapon in the novel. So possibly Smith had read other stories with force shields and decided to one up them with one that could be used offensively.
Anyway, that is the earliest example that I can think of. An earlier example has to be found or Skylark Three will remain the record.