How to install google apps when android built from source I added a kernel module to the msm flo kernel. I built android JB from source for my Nexus 7(flo). I flashed the device with the built OS. I can add 3rd party apps for which I have apks or I could add them to the source tree.

But I can't add google apps or anything from the play store. I can't add my google account under settings->add accounts since it doesn't exist. I tried installing google play store by downloading the apk to my machine and installing it with apk. Play store does install, but play store crashes as soon as I click on it.

Is there anyway to fix this issue?

I am using ubuntu 14.04
There is a lot more to the Google Apps than just downloading and installing the APK.  Google's Services framework and apps (a.k.a. GApps) are not part of AOSP which is probably where your source comes from, but they are required for Play Store and other apps to work properly.

Unfortunately GApps is closed-source, so it's not allowed to re-distribute these portions.  However, since your Nexus 7 tablet shipped with them, you should be able to easily find all the necessary components in the original image.  Alternatively, you should be able to find the GApps package for your specific Android OS version that works on your tablet over at XDA-Developers forums.