Who said that? The shingle manufacturer who doesn't honor the 25-50 yrs warranties anyways, or the installer who will maybe only honor workmanship for 1 yr, and that's a hard maybe?
No, installing panels on your roof doesn't 'void the warranty'. It's just that each part is covered separately now. The install by the installer, the shingles by the manufacturer (good luck), and the solar rack (and penetrations through the roof caused by mounting it) by the solar installer.
Also, having the panels covering your roof means the shingles beneath are protected from UV and heat and thus should last even longer than they normally would. In fact, the perfect time to install the panels is considered to be when you get a new roof.