Desensitization and counter conditoning might help. Start doing something that your dog likes and reward him/her then try slowly increasing the criteria.
Try starting in a completly different context first. If you've always cleaned the ears in the kitchen, try the bedroom, or try the yard.
Touch the dog in a favorable place like the chest; click and treat. Touch the dog on the face; click and treat. Touch the dog on the tip of the ear; click and treat. Touch the dog by the base of the ear; click and treat. Try a very light, very quick rub; click and treat. This could take several days. If you move up to a point where the dog is uncomfortable, you have moved too fast.
Once you can handle the ears, then you start all over with the solution. Show the dog the bottle or cotton ball; click treat. Move it closer; click, treat. Touch the dog for a second; click, treat. And so on and so forth.
Several books by Jean Donaldson address body handling exercises including Culture Clash, Dogs are From Neptune and Oh Behave.
Trainer Emily Larlham has some good videos on desensitization and counter conditioning. Here is one. Other videos can be found on her channel.
Another thing to try is the Jolly Routine as described by William Campbell in the book Behavior Problems in Dogs. Act like ear cleaning is the funnest thing in the world. Get happy and giddy and talk lots of baby talk while you are putting the solution in his ears.
Another thing to try is playing with or petting the dog before you start putting the solutions in.
You can put a big glob of peanut butter in the dog's mouth. Or try the technique demonstrated by Dr Sophia Yen here
When treating for ear cleaning, find something that the dog likes a lot - like boiled chicken, cheese, etc..whatever is his favorite. He only gets that food for ear cleaning. Never any other time.