Have you tried spraying the leaves of the plants with a soap solution?
Here are some clever suggestions:
Craig said, "I've also put a dish of vinegar in the microwave with the door open. Turn the lights off and go to bed. In the AM shut the door and zapp them for a minute. DONE. Serve warm to chickens
Michael said, "Has any tried using a venus fly trap to fight this fruit fly battle?
Laura said, "I had the oddest experience, they didnt like the dry red wine i left them....shrug i went back to cider vinegar. I put it in a wine glass to keep evaporation down...any of the other methods seem right to me I will save a liquor bottle.
https://permies.com/t/176/Fruit-Flies