MOGHKHAIL, Afghanistan — The A-29 attack plane was a white speck in the bright skies over eastern Afghanistan as it launched a dummy bomb that exploded just yards from the target, a wrecked truck. “Spot on!” said an American adviser watching the exercise.

The plane’s Afghan pilot had been guided by an Afghan coordinator on the ground — but only after previous bombing runs had struck well wide of the truck.

Eleven years after the United States began building an air force for Afghanistan at a cost now nearing $8 billion, it remains a frustrating work in progress, with no end in sight. Some aviation experts say the Afghans will rely on American maintenance and other support for years.

Such dependence could complicate President Trump’s moves to extricate the United States from the 17-year-old war against Taliban insurgents — a war in which they lately appear to be gaining ground.