You get Cranidos and Shieldon by restoring the Skull and Armor Fossils, respectively, in the Lab at Ambrette Town by giving them to the man behind the counter. They can be found by smashing rocks in Glittering Cave.
You can get their fossils in Glittering Cave by using Rock Smash. (Skull/Armor Fossil)
You can then revive their fossils in Ambrette Town by giving them to the man at the counter in the Fossil Lab.
In the postgame of X/Y, by using Rock Smash in Glittering Cave, you have the chance to stumble on a fossil.
The Skull Fossil for Craniados.
The Shield Fossil for Sheildon.
Source: Here :3