For at least two months now, U.S. State Department officials have been hinting of an imminent resolution of the sometimes-bloody independence struggle in Namibia. Chester Crocker, assistant secretary of state for African affairs, has been positively lyrical in his optimism that the Reagan administration's carrot-but-no-stick policy toward South Africa will be rewarded, and soon, with a settlement in Namibia.

Black Africans, on the other hand, remain uniformly doubtful that any substantial progress will be made toward full independence for the continent's last colony, the erstwhile South West Africa. Sam Nuhoma, president of the Southwest African People's Organization, the political faction most likely to win an election and take over the Namibian government, puts it baldly: "The South African racist regime has no intentions of relinquishing its colonial domination over Namibia."

The Africans' pessimism is based, in large measure, on the fact that the South African government, which has ruled Namibia (illegally, according to the United Nations) since 1966, has consistently resisted implementation of the U.N. settlement plan that calls for elections and an end to South African occupation.

The Carter administration, which had tried to pressure South Africa into implementing the settlement plan, made virtually no headway, although South Africa was a signatory to the U.N. plan. The Reagan administration abandoned the stick of coercion for the carrot of cooperation. "As long as there's a sincere and honest effort being made, we should be trying to be helpful," Reagan has explained.

Crocker and the others say the approach is working.

But is it? The current South African explanation for stalling on Namibia is the presence of Cuban troops in neighboring Angola. It seems reasonable enough on its face. Surely the rabidly anti-communist South Africans would like to see the Cubans out of Angola. The United States certainly wants them out. And even the Angolans, who are paying a heavy price for the presence, economically and otherwise, might be glad to get rid of them. So why are they still there?

Randall Robinson, executive director of the Washington-based TransAfrica, offers some clues:

"The Angolan government has insisted all along that the only reason for the presence of the Cubans in the first place was the military threat to Angola from South Africa. Every time the Angolans diminish the Cuban troop levels, South Africa invades Angola again -- most recently just last month.

"When I met with Castro in March, he told me that the Cubans would leave Angola when South Africa no longer constituted a threat. One theory, then, is that South Africa does not really want an agreement on Namibia, and since the Cubans provide a workable rationale for stalling, South Africa does not really want the Cubans to leave. Why else would they invade on the very eve of a hoped-for breakthrough?"

Is the American government simply being naive? Robinson doubts it. He displays what he says is a leaked copy of a top-secret State Department document indicating that the Reagan administration knew in advance of South Africa's invasion plans. "Foreign Minister Botha recently warned the U.S. Embassy that Pretoria would feel compelled to launch a large-scale attack if its deadline of mid-August for completing negotiations on Namibian independence and withdrawal of Cubans from Angola is not met," the July 28 document said at one point.

"Pretoria's buildup in Namibia (confirmed by U.S. aerial reconnaissance photos) and its current deployments in southern Angola . . . are similar to those that preceded the 5,000-man incursion into southern Angola last August and September."

Robinson asks the obvious question: if the Cuban presence is the reason for South Africa's stalling, and if the South African invasion -- of which the United States had advance knowledge -- would guarantee the continued presence of the Cubans, how can the United States credit Pretoria's claim that it is seriously interested in a settlement?

The answer must be either that the State Department knows what it has been unwilling to acknowledge or that it is hopelessly naive regarding South Africa's real intentions. Donald McHenry, the former U.S. ambassador to the United Nations, leans toward the explanation of naivet,e. The Reagan administration, he suggests, thinks that it is seeing a new play while black Africa knows that what is going on is a long-running play.

Oumarou Youssoufou, executive secretary of the Organization for African Unity, puts it more directly:

"The problem," he says, "is that the Americans believe the South Africans, and we do not."