I was trying to open the location setting page in mobile settings if the location service is turned off. I used diagnostic plugin to to that but when im trying to generate the application it show error "Error installing Cordova plugin: cordova.plugins.diagnostic". 

Can anybody tell me how to fix this or can you suggest any other alternative.

As far as I know, for what I've seen recently, this plugin have some kind of incompatibility with the platform SDK.
Don't know if there is a solution already, without messing with the plugin code (Java/Swift).