There seems to be an issue with me and a very close friend of mine. I'm 20 and he's 21. I don't understand the sudden change of his behaviour. So any feedback on my situation shall be greatly appreciated. Thanks in advance.

It all started from last summer in which he started flirting with me. I kindly told him not coz I didn't want our friendship to get ruined. He avoided me for literally 3 weeks.*But within that time I was acting fine as though nothing happened so things didn't seem awkward between us. But he was still acting cold towards me even though I was absolutely cool with him.*
Because we're family friends, he and his family came down for my cousins wedding. But I avoided him coz I was annoyed with the way he blamed me for the flirting although he was the one who had started it. However, he started the flirting again but was more open and became extremely complimentary. I was confused and shocked coz I didn't think he'd start it again. Within minutes of explaining why he avoided me, he said he couldn't stop staring at me and how he thought I looked pretty during the wedding. He said he purposefully sat across the room opposite me, just so he could look at me. He said he only had eyes for me.
However, few days later he said that my nephew called him up and asked him if me and him were together. But the thing is my nephew has never seen me and him together. We only talked via text and that's it, not face to face. My friend suggested that we should avoid each other for a while but I kept saying no coz there's nothing going on between us and if we do ppl will think that there is. However, he still decided to avoid me for a bit and even blamed me coz my nephew asked him. I had nothing to do with it of course. Him and my nephew were together all the time. So that never made sense.*
A week later I received a message from his brother in law on *facebook. He does know me coz my family and his are friends. I didn't quite get why I got a message though. It just said 'hi' and that was it. I didn't reply. I asked my friend and he said he doesn't know and that I should ask him. I never though just incase he was gonna ask me something regarding this.*
Within that time tho I was still fine and acted like a friend. But he used to ignore me for no reason. So I always used to be on his case and used to ask what was wrong etc coz he doesn't talk when I try and have a conversation. It used to be annoying coz he used to flirt with me all the time and then always avoid me as in be would ignore my texts. So I asked him and he said he wants to talk to me but he gets worried when we start flirting coz he doesn't know if were both still joking or being serious. He said he trusts me. At the time I didn't know what he was asking me, so I just left it.*
So the viscous cycle kept repeating itself, he used to flirt and open up but them always avoid me. Like the next day I'd start a normal convo but he would ignore me. That kind of frustrated me coz I didn't want him to get the wrong impression. I just wanted it go back to normal and I took the role of sorting things out. But he always used to make excuses like he was busy and he'd be mean and cold as well. Inside I used to feel upset coz it's like he never realised my effort to get things back to normal.
*So I asked him whether he was joking or being serious. He said he was joking first but when I said it he said that's alright but then he said he doesn't think I'm being honest. I don't get why he said that. But then he said if we both weren't being serious then that's the problem. Since then he's been completely awkward and very cold. It's been like this for months and I try all the time to sort things out. But he never tells me what's wrong.*
About a month ago he said he enjoyed the flirting n that's why he hasn't been talking to me. He said my nephew asked him if he liked me n he got scared he would go n tell everyone. But I dnt get why he got asked that. I just don't see why he would avoid me over something that isn't true. I think that's ridiculous and stupid. We're friends so I dnt get why he would have to avoid me and blank me coz of that. I take him as a friend but he's so awkward. I just wanna talk to him on the level not flirting.
*The other day he said he doesn't wanna talk to me and he has nothing to say*to me. He said I'm a friend n that's it. But before he said all this I had always said that to him. Ive told him I just wanna talk to him like normal. He's blamed me. He even said it's like as though I'm obsessed to talk to him. Like seriously, what the hell!! How could he even say such a thing coz that just isn't true. All I've been trying to do is maintain our friendship but he's too busy acting awkward with me. Now I don't bother sorting things out. I just don't get why he's being so cold and weird with me. What's his problem????
Is it my fault it's like this now due to me trying time after time to resolve the issue?? Is this why he's acting like with me now??