I think if you wrote it like, "I like apples, but I do not like bananas." It would make more sense. If it's for a test question, then I'm pretty sure the punctuation is correct because there needs to be a comma after however.
Answer: incorrect
..............................
9.4m questions
12.2m answers