Take a step back. Everyone lies. Oh, I'm sure there are people somewhere who never do, but it's so rare as to be statistically insignificant. And I don't mean anything bad by it. Saying what needs to be said for your own benefit is as natural as anything else. Even nonhuman animals are dishonest when it helps them out.
But when it comes to the things that materially matter to others, inherent honesty, and dishonesty, will (as Holly said) shine through. I've found that when I screw up on something with a client, it's far, far better to say, "Sorry. I screwed up. It's my fault. I will make it right," than to say, "It wasn't my fault. The computers crashed and we've spent three days reformatting and it's been such a nightmare," and so on.
And it may not seem so at the time, but in the long run, people appreciate the honesty. Now, you do have to have some native competence. You can't make "I screwed up, sorry" into a career plan.
And there's honest and there's unnecessarily honest.The old joke, "Honey, does this dress make my butt look big?" "No, your butt makes your butt look big," might be a paragon of honesty, but it's also hurtful and stupid. On the battlefield of honesty and human relations, it's far better to call a retreat on this one and live to fight another day. (Me and other prudent guys might say, "Honey, you don't know how to make your butt look big," and see? Everyone lies.)
So sure, honesty can lose friends. Some people don't want honesty; they want affirmation, and the honesty is destructive to them. Some people don't want to hear how bad it is; they want to hear what'll make it better, and an honest assessment sends them into a tailspin. However, some people need honesty over affirmation, and they need to hear how bad it really is. The trick in dealing with people honestly is to find the balance between effectiveness and human considerations.