Meghan Trainor says it's not fair" that Jennifer Lopez has received online criticism over her new single 'Ain't Your Mama' because Dr. Luke previously worked on the track.

Meghan Trainor

Meghan Trainor

The backlash came after J.Lo performed her new single on last week's 'American Idol' finale and it was revealed that Luke, who has had as yet unproven allegations of serious sexual abuse made against him by Kesha, had worked with Meghan on the track before it was handed to her.

Meghan has now spoken out to say that J.Lo never knew at any stage that Dr. Luke - real name Lukasz Gottwald - had worked with her on an early version of the track.

The 'All About That Bass' singer told Digital Spy: "I texted her the song and she had no idea - she thought I did it alone by myself at my house, which a lot of people think because I do that. I sent it to her and said, 'Do you like the song?' And she said, 'I love the song, my kid loves the song - he's made me play it five times already so I know it's a hit - when can I cut it?', so I said immediately, 'Whenever you want!' "

Among the avalanche of complaints to J.Lo on Twitter included one fan tweeting: 'I love @JLo but I will not support a song produced by rapist and monster dr Luke. I'm so disappointed you still worked with him.' (sic)"

While another Twitter user urged fans to boycott the single by writing: "Not Your Mama, @Jlo's new single, is a ladies anthem that was produced BY Dr. Luke ... Funny. Don't buy the song #SaveKesha (sic)"

Continuing to defend J.Lo, Meghan added: "(It was) not fair on her, not at all ... I felt terrible when Jennifer got all the hate for 'Ain't Your Mama', and it's just all ridiculous. It's such a big song for her."

The collaboration is likely to have come about as Jennifer and Meghan are both signed to Sony Music - the same umbrella company that houses Dr. Luke's Kemosabe Records, through Epic Records.