Thank you for clarifying. Perhaps it was the lateness of the hour but I didn't realize that the landlord and your friend were two different people, as you referred to both of them as she. This new information modifies my answer, but it does not completely change it.
If you have been invited to your friend's home, then you have permission and authority to enter the building to see her. So you wouldn't be trespassing if you went to see your friend. BUT her landlord also has rights and has made it clear that she does not want you in her building and that she will take action if she finds you there again.
Presently, there is no order of protection against you. The warning that you received from the police is simply a courtesy to both you and to the landlord of the building so that you can regulate yourself accordingly. But this is where the answer I have provided you already kicks back in. Can she call the police and say that you are trespassing? Yes, she can. Can the police then show up and arrest you, even though both you and your friend tell them that you were invited onto the premises? Yes, they can, because they warned you already that they would do that.
Could you then be convicted of this charge? That's a different story, because the state would have to show beyond a reasonable doubt that you were trespassing, and that might be difficult given the whole history and background of this situation. But it doesn't mean that the state can't try if they want to.
Or, maybe she will not call the police and have them arrest you at the scene but simply go to the courts and swear out a protective order and then have you served with that order. That would make you a defendant on a criminal
matter -- trespass (or harassment if she feels you are deliberately putting yourself in her way and she claims to be fearful of you) -- and would keep you from your friend at her place ever again while that order is still in effect. That is because such orders usually scope out how physically close you can actually get to the complainant (generally can't come within 1,000 feet) which would be enough to make her whole building off limits to you regardless of the wishes of your friend who lives there too.
So in the end, we come down to the same thing. This may be spiteful. Or she may mean it. But one way or the other the law is likely to enforce it. And while you will get your day in court to get a judge or jury to consider your side of the story, you will do so as a defendant on a criminal case.
The safer policy would be to see your friend elsewhere and let the landlord calm down before setting foot on her premises.