Do you realize how important it is to be and have a good friend? Assuming you are there when your friend needs you, are they there when you need them? What happens if you either deliberately or inadvertently say or write something to your friend that hurts their feelings?
Taking it another step further, what happens if you tell your friend the truth and it's not what he or she wants to hear? Perhaps you shared your feelings and your friend misinterpreted your words and intentions? Maybe they reached out to another person for their opinion, and a wedge was then put into your relationship, possibly destroying it forever? That hurts very deeply, I am sure. If your fears and issues had not entered the picture, would this relationship continued to go on unscathed? Probably not. More than likely something else would have come up over time to test this relationship. The issues in relationships are always there. Misunderstandings always happen. It's how we handle them that matters. Take care of yourself and take your time when dealing with your desire to express yourself. You should be able to live comfortably with the results of your verbal or written choices.
My mother used to say, "The road to hell is paved with good intentions." I think she may have been right. No one likes confrontations. No one likes to be wrong. No one likes to feel that they have been taken advantage of, not been given a chance to apologize and have that apology accepted, or be given a chance to explain what they felt, what they did, and why.
The best thing you can do is to be thankful for the experience, understand that possibly your trust and fear issues may have gotten in the way, and maybe there was a good reason everything turned as it did. That's the hardest thing to accept because you may not have the answer to that for some time.
My intuitive and practical suggestions would be to accept that your relationship is no longer the same. This would allow both of you to find your own way in life -- focus on your own stuff and allow each of you to grow in different directions. Over time, you may realize that you had spent more time helping your friend achieve their dreams, and you had let your own languish, or was it the other way around?
Perhaps down the road, enough time and distance will allow you both to reconnect in a positive and forgiving way.
Is there a solution for this? I think so. I recommend learning to be comfortable in your own skin. These types of things will always happen. Own up to your words and know that as long as you live your life with honesty and integrity you can find peace in knowing you tried to do the right thing. In time, perhaps your friend may realize that you were only trying to express yourself, and you wanted to let them know how you felt. In the meantime, say a prayer or two for all of you, send them your love and good wishes for their journey and be grateful for having traveled that road on your journey through life.