It must have looked like a publicist's dream for a young presidential hopeful - exotic setting (Africa), popular issue (ecology), a female superstar in tow (Linda Ronstadt). Unfortunately the supporting cast turned out to do nothing but distract from California Gov. Jerry Brown's attempt to make the leap to international statesman.

The governor's visit was utterly overshadowed by the political events in Kenya's neighboring two countries where the determination of Tanzanian President Julius Nyerere had succeeded in replacing Ugandahs Idi Amin with a modest academic as president after a six-month war. No wonder Brown kneeling at Easter mass with President Nyerere at St. Peter's in Dar es Salaam yesterday looked so like an adoring student whose only wish is to follow in the footsteps of Mwalimu (teacher), which is Nyerere's nickname.

The media, mostly American, was, without doubt, to blame for the lack of success of Ronstadt's contribution to the governor's trip. Not only did they repeatedly ask whether the couple were about to be married on Mount Kenya or on Mount Kilimanjaro (inconveniently just over the border in Tanzania, but everyone was happy to charter a plane), but the photographers wanted to take pictures of Ronstadt when they should have known she is allergic to celluloid.

Ronstadt arrived in London last night ahead of Brown, still apparently seething over the constant press coverage during their African jaunt and deriding reports of a marriage. She had not accompanied Brown to Tanzania, flying directly from Nairobi.

"Would you marry somebody yo1'd known for just two years?" she asked at Heathrow airport. "I know some rock stars have reputations for whirlwind romances, but I don't."

Has Brown proposed to her?

"No, he hasn't, and I'm not going to say any more." Brown was scheduled to arrive in London later last night.

The star was rumored to be fascinated by African wildlife, but in her week in the continent's best gameviewing country, managed only a brief 24 hours in a reserve. Most of the rest of the time she spent shut up in her cottage in Nairobi's Norfolk Hotel, the old-fashioned English-pub type place the settlers used to like when they were here, and which is now the haunt of rich Americans.

The governor, meanwhile, put considerable energy and time into wooing the ecological elite of East Africa. The United Nations Environment Program (UNEP) is based here, producing yards of paperwork on the subjects dear to Brown. Some meeting of minds clearly took place as Brown attended a UNEP party in his honor and stayed three hours instead of the 15 minutes he had promised.

Paying a courtesy call on Kenya's President Daniel Arap Moi, Brown invited him to California. He also proposed in the one tangible contribution to Africa of the entire trip that a "Peace Corps" of solar energy technicians should be organized by the United States to try and tackle the Third World's enery crisis. This is nothing to do with saving gasoline by using smaller cars, but concerns the chronic deforestation of the Third World's rural areas whose only sources of energy besides dried cow and camel dung are twigs and charcoal.

On a one-day trip to Mount Kulal in the desert of northwest Kenya, Brown looked first hand at UNEP's modest range management and reforestation project and said there were many parallels with the problems of California. Seeing him have his picture taken with a Rendille warrior covered with red ochre in one of the tribe's movable settlements you could imagine it going down well back in California.

Addressing the continent's biggest issue, Brown suggested in Dar es Salaam that Britain and the United States should have put more pressure on Rhodesia's Ian Smith to bring about a settlement of the 13-year-old rebellion. It may sound tough and brave back in California, but closer at hand, the word that came up in comment was "naive."

The governor and Ronstadt arrived in Nairobi last Monday night from the Liberian capital of Monrovia in West Africa, where Brown went at the invitation of President William Tolberths son who had visited him in California last year. At Nairobi airport, Brown and Ronstadt followed the procedure they started in Liberia and stuck to throughout the trip - separate exits from airplanes, separate cottages at the hotel and most of the day spent apart.

Even the most hawk-eyed of reporters only managed to see him kiss her once on the tarmac at Monrovia - and hold her hands once - during his 41st birthday dinner in Monrovia where they watched a snake charmer.

Ronstadt made no attempt to make herself publicly agreeable for her holiday. Her demeanor was typified by the time she snarled at a photographer who touched her shoulder. "You put your hands on me again and you'll end up with a broken windpipe."

If togetherness or some sort of return to nature was in the governor's mind when he brought his friend on the trip, it looks as though he miscalculated badly. Ronstadt was not on the weekend hop to Dar es Salaam, remaining at the Norfolk Hotel in Nairobi.

In contrast to Ronstadt's unmasked dislike of the press, Brown did grant a few short statements to reporters who stuck to him doggedly. As most of his remarks concerned that most intractable of subjects - the environment - most reporters did not find much in their notebooks at the end of the day.

However, in contrast to Ronstadt, Brown appeared extremely mild, if not exactly the austere figure he likes to cut as he slipped into African robes for dinner in Monrovia or wore white jeans into the poverty-stricken Kenyan desert. CAPTION: Picture, Singer Linda Ronstadt and California Gov. Jerry Brown in Kenya; by AP