For me, the loneliness went by working the steps to re-humanise me again and remove the many blocks to me forming decent relationships with other people; by engaging fully in work and other useful activities; by engaging fully in fellowship and service in AA; and by making myself available to sponsor anyone who asked, regardless of the inconvenience.
I've heard several hundred Step Fives over the years. Each one has played its part in removing my loneliness and the loneliness of the other person.
I always wanted one person to fix me. That was the mistake. I needed to take up my role in the lives of many other people and to be a channel for my Higher Power. THAT got rid of the loneliness.
A one-on-one relationship may or may not be part of the solution; in practice, it simply gave me another person to forgive and another person to serve; it does not solve the form of loneliness that is essentially anxious apartness stemming from a life of self-centredness and self-absorbed thinking. It was that that needed to be stripped from me.
Fortunately, in engaging in the activities outlined in the first paragraph above, there have been no end of people willing to be part of the journey. Since making the decision to engage fully in the transformative process of the Steps, which took place around 22 years ago, I have never been lonely in the way I was before I came to AA, except when I drifted from the tried-and-tested path.