LOS ANGELES, JUNE 19 -- The Department of Justice abruptly dropped criminal charges today against General Dynamics Corp. and four company executives, including former NASA administrator James M. Beggs, conceding there was insufficient evidence to prosecute them for alleged fraudulent mischarging on a contract to build the Sgt. York antiaircraft gun system.

The dismissal order, signed by U.S. District Court Judge Ferdinand F. Fernandez, cleared Beggs and three other executives of charges that they defrauded the government of an estimated $3.2 million by writing off development costs on the weapon to unauthorized accounts.

In seeking the dismissal, government prosecutors acknowledged that General Dynamics had been correct in its original interpretation of the contract, which the company maintained simply required it make its "best efforts" to stay within the $39 million development cost for a prototype weapons system.

"We at General Dynamics are very pleased that the government has filed a motion to dismiss the . . . indictment," board chairman Stanley C. Pace said in a statement.

Beggs, who had headed the company's Pomona, Calif., division when the problem-fraught weapons system was under development, resigned as administrator of the National Aeronautics and Space Administration after the criminal indictment was handed up in 1985.

The three other executives named in the indictment, Ralph E. Hawes Jr., David L. McPherson and James C. Hansen Jr., are still employed by the company.

Government officials would not comment on the dismissal, but they acknowledged in court papers that "testimonial and documentary evidence" uncovered after the indictment caused them to reevaluate their interpretation of the contract.

The contract arose out of a decision by the Army in 1977 to build an air-defense-gun system that would accompany tanks.

Development costs were estimated at more than $330 million over a period of at least eight years, and as a hedge, Congress awarded two prototype development contracts to General Dynamics and Ford Aerospace, one of which would eventually be awarded the final development contract.

The indictment alleged that General Dynamics used illegal accounting techniques to hide the true costs of its two Sgt. York guns.