"the discussions go nowhere. I often get emotional and he says he doesn't know what's going on or how to fix it. Then we apologise to each other and brush it under the carpet. He says he loves me to bits and that it's nothing to do with not being attracted to me".
1/ he's not interested in having sex with you anymore. Some men prefer their right hand and fantasy than the complexities of sex. Some men also like the control that withdrawal from the relationship gives them - this is a form of passive aggression, which can never be 'solved'.
2/ it won't get better. you cannot mend this sort of problem (been there - wasted years of my life). I would advise anyone, from my vantage point of nearly 60 years (and a lot of experience) - to give sexual problems a strict time limit, if you must, if you love someone. 6 months, 12 months. Then leave. Even then, if it improves, I would put money down the problem reappears.
3/ he's saying what you want to hear because he cannot bear the upheaval if he is honest.
4/ he says he doesn't know whats going on. he knows exactly what's going on. He's dissembling because of no 3. The "I love you to bits" is the trump card.
5/ he's got you caught in a cruel trap - my ex did this to me. couldn't live without me - it was forever. he didn't know why, but couldn't respond to me anymore. so we would go round and round and I would brush it under the carpet.......wasted years.
6/ the way out is through the door.