Unable to run production build command for android in ionic cordova application

When I run ionic cordova build android --prod --release command in cmd prompt, I’m getting the below error. I thought of checking because of “AOT” it might be failing and I also tried running ionic cordova build android --prod --release --aot=false same result failed.

Error encountered resolving symbol values statically. Calling function ‘NgxDynamicTemplateModule’,function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in /src/app/app.module.ts, resolving symbol AppModule in /src/app/app.module.ts

using ionic 3.20.0 and cordova 8.0.0

Thanks in advance