I just found out that I should replace my (currently asphalt shingle) roof in the next year. I am also interested in evaluating the feasibility of installing photovoltaic and/or solar hot water panels. So I am wondering if it makes sense to look at the timing of these projects in tandem. Is there a reduced risk to having leaks, etc. if I get any panels installed near the same time as replacing the roof?
You certainly don't want to install the solar panels before redoing the roof. Outside of that obvious point, I don't think it matters much. In Theory, having the panel supports installed as part of the process of redoing the roofing could make things simpler and better sealed, but in practice there are very few, if any, teams trained to coordinate these tasks.
I would think about redesigning the roof to make the panel supports integral to the roof. Or you might keep a close eye on Elon Musk's work around solar roofs, where the panel IS the roof.
Or go the opposite direction and get enough wind under the panels that the panels place your house effectively in shade, easing your cooling bills. Bonus points if there's room for roofers to work under the panels.
Honestly, I'm no fan of rooftop solar. I prefer standalone racks over places where you park cars (i.e. that are already paved and are made better by placing in shade). You can aim exactly correct, and firemen don't freak out about being shocked if they climb on your roof. Bonus points, the paved surface allows servicing from the underside with a simple cheap scissors lift.