I know this is a duplicate but i am unable to comment on this thread in order to find out a solution. I have done exactly as the accepted answer but my problem isn't solved. I am running Ubuntu 17.04 on a laptop with Intel Core i7 4th Gen Processor, 8GB RAM, 256GB SSD and Dual Graphics. I have installed nVidia Prime drivers and switched to Intel graphics card because it performs better than the nVidia.
I have created a Virtual Device with the following settings:
Device: Google Pixel with API 26
Graphics: Automatic(i have tried both software and hardware btw).
RAM: 4096MB
VM Heap: 1024MB
Internal Storage: 4096MB