Both are hard to master by themselves.
I can't think of anyone that has mastered both. Kanye is the only one that saw great success doing both. And he didn't even master rapping. His beats saved him.
Dr Dre and other producers had ghostwriters.
The best option to master one really well and do the other one now and then. Just like Dre and Kanye mastered producing; and Eminem mastered rapping and occasionally produces.
I think that is what's holding J Cole back. His beats are boring. He should stick to rapping.