I am trying to run the APK on API 22 device after updating compileSdkVersion to N but unable to do so.
API 22
compileSdkVersion \'android-N\' buildTool
You can't do it without hacking the solution. It is a limitation of the N-Preview and you have to use only this config:
android { compileSdkVersion 'android-N' buildToolsVersion 24.0.0 rc1 ... defaultConfig { minSdkVersion 'N' targetSdkVersion 'N' ... } ... }