When did the trope of spacecraft having shields start?

ST:TOS had automatic shields. There is at least one episode where the Enterprise was alerted to a possible threat by the shields snapping on.

No, that was the Hydrans.

I think I saw that in the pilot, with Jeffery Hunter (Capt. Pike).

The shields snap on when the sensors detect what turns out to be an “old style” radio wave approaching them.

Well of course, but you have claws that can dig into meters-thick armor of pure neutronium…

I think it’s a natural outcome of having energy weapons, to have energy shields.

Also, it means you don’t have to show damage on your models, which is handy.

To give Doc Snith even better priority, “The Skylark of Space” was written in 1919, if not published until later in the '20s. Hamilton certainly used them, as did Campbell. It is not surprising that they caught on since they allowed an arms race between ever more powerful energy weapons and ever stronger shields, not possible since no one would believe that any material would stand up to a gigantic death ray. (Which itself was used by Wells.)

By the way, ST-TOS was a bit fuzzy on shields in the beginning. In “Balance of Terror” Spock shows that the shields of the earthbase were weakened in the conference room, though the Enterprise itself uses normal energy shields in the battle.

I like the shields that Niven/Pournell used in The Mote in God’s Eye: They’ll absorb pretty much any kind of energy, and in the process, they heat up, and the shield incandesces, eventually getting red-hot, white-hot, and so on. At some point, when they heat up too much, they burn out, generally destroying the ship in the process (the same thing happens if you try to deactivate them before they’ve cooled off).

All forward power to the Hypno-Toad!

Outpost four with Commander Hanson, he said the outpost was a mile deep on an asteroid almost solid iron and even through their deflector shields the Romulan weapon almost destroyed them with one blast. I assume the metal Spock crushed was part of the outpost’s physical armor the base was projected by as well as it’s shields. BTW the armor was Castrodinium.

I had a defense system a lot like that in a '72 Pinto.

Not energy shields, but the spaceship in From the Earth to the Moon, by Jules Verne (written in 1865) had force fields, if you use the definition in the staff report by Karen.

The late Everett F. Bleiler did the impossible (and unthinkable) and read every single work of what conceivably could be called science fiction to appear before the Campbellian Golden Age.

Not only that, but he wrote summaries of them, more than 5000 in all, and collected those into two volumes, Science Fiction: the Early Years and Science Fiction: the Gernsback Years. They are jaw-dropping feats, not least since he had to do them before the Internet made so much old material easily available.

And he did a “Motif and Theme Index” for them.

There is no entry for shields, but there is one for force fields. Most are offensive weapons, but a few are defensive. I found these (alphabetical by author):

No spaceships, though. Stories about space were infrequent at best through the 1920s. Aliens were always thoughtful enough to come to earth. No E. E. Smith either. He’s in the second volume. *The Skylark of Space *wasn’t published until 1928.

William Hope Hodgson’s The Night Land is not listed under this trope and Bleiler’s description has the pyramid surrounded by a ring of earth-current flame rather than a force field. Most of these force fields were secondary elements to the story, so there’s no sure way to tell if all of them were listed.

Shields might be helpful against radiation, although heavy; but as far as defence goes they’d be as pointless as weapons: there’s no-one out there.
No-one you’re gonna meet, anyway.

I wouldn’t consider the Night Land example to be a force field. Hodgson was an early writer of “weird detective” fiction, and one of his standard devices was the “Is it magic or is it science?” trope, while another was “A scientific approach to manipulating magic” (i.e., sort of the flip side to magic realism). The shield in the Night Land falls into the latter category; it’s better to think of it as a scientific pentagram. When Our Hero embarks on his journey and reaches the shield, he’s disconcerted to discover that it’s basically a fluorescent bulb that he can easily step over.