Trees ( maybe some other sorts of plants as well) near walls of buildings with sub surface basement, near terrasses, near concrete or plastered ways etc. can be a big problem in the long run, since the roots may destroy the sealing of a wall resulting in molded basements and health problems, and can lift and brake ways even made of concrete.
The leaves or needles of high trees near buildings can clogg the tiles of roofs in a way that water can flow horizontally into the building. High trees can attract lightning. Plants near buildings can help burglars to be not seen by neighbours - and to get into upper floors.
As a rule of thumb, a distance of 15m should be to the next sub surface construction.
A photovoltaic screen protects the wall against heating up and can amortize in 6 to 20 years depending on sunshine duration, subsidiaries, own consumption, installation costs, feed in vs. feed out tariffs, maintenance costs.
A PV system is a safe energy source during daytime in emergency situations or in locations with frequent power blackouts or shut downs.