title: ionic cordova build android failed due to AOT
body: <p>I am new to ionic. I have created new application using the ionic framework. But when I hit command ionic cordova build android --prod --release build failed with AOT exception..</p>
  
  <p>Everything working fine if I hit command ionic cordova build android --release without --prod flag.</p>
  
  <p>Error Message:</p>
  
  <p>$ ionic cordova build android --prod --release
      Running app-scripts build: --prod --platform android --target cordova
      [14:03:18]  build prod started ...
      [14:03:18]  clean started ...
      [14:03:18]  clean finished in 2 ms
      [14:03:18]  copy started ...
      [14:03:19]  deeplinks started ...
      [14:03:19]  deeplinks finished in 47 ms
      [14:03:19]  ngc started ...
      [14:03:27]  typescript error
      Type AudioCategroyPage in C:/xampp/htdocs/study-baba-beta/src/pages/audio-categroy/audio-categroy.ts                                                      is part
      of the declarations of 2 modules: AppModule in C:/xampp/htdocs/study-baba-beta/src/app/app.module.ts                                                      and
      AudioCategroyPageModule in
      C:/xampp/htdocs/study-baba-beta/src/pages/audio-categroy/audio-categroy.module.ts! Please consider mo                                                     ving
      AudioCategroyPage in C:/xampp/htdocs/study-baba-beta/src/pages/audio-categroy/audio-categroy.ts to a                                                      higher
      module that imports AppModule in C:/xampp/htdocs/study-baba-beta/src/app/app.module.ts and
      AudioCategroyPageModule in
      C:/xampp/htdocs/study-baba-beta/src/pages/audio-categroy/audio-categroy.module.ts. You can also creat                                                     e a new
      NgModule that exports and includes AudioCategroyPage in
      C:/xampp/htdocs/study-baba-beta/src/pages/audio-categroy/audio-categroy.ts then import that NgModule                                                      in
      AppModule in C:/xampp/htdocs/study-baba-beta/src/app/app.module.ts and AudioCategroyPageModule in
      C:/xampp/htdocs/study-baba-beta/src/pages/audio-categroy/audio-categroy.module.ts.</p>
  
  <pre><code>Error: The Angular AoT build failed. See the issues above
  at C:\xampp\htdocs\study-baba-beta\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:237:55
  at step (C:\xampp\htdocs\study-baba-beta\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:32:23)
  at Object.next (C:\xampp\htdocs\study-baba-beta\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:13:5                                                     3)
  at fulfilled (C:\xampp\htdocs\study-baba-beta\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:4:58)
  at &lt;anonymous&gt;
  [14:03:27]  copy finished in 9.27 s
  </code></pre>
  
  <p>My Deployment Info.
  cli packages: (C:\Users\shaggy\AppData\Roaming\npm\node_modules)</p>
  
  <pre><code>@ionic/cli-utils  : 1.19.0
  ionic (Ionic CLI) : 3.19.0
  </code></pre>
  
  <p>global packages:</p>
  
  <pre><code>cordova (Cordova CLI) : 8.0.0
  </code></pre>
  
  <p>local packages:</p>
  
  <pre><code>@ionic/app-scripts : 3.1.6
  Cordova Platforms  : android 7.0.0 ios 4.5.4
  Ionic Framework    : ionic-angular 3.9.2
  </code></pre>
  
  <p>System:</p>
  
  <pre><code>Node : v8.9.1
  npm  : 5.5.1
  OS   : Windows 7
  </code></pre>
  
  <p>Environment Variables:</p>
  
  <pre><code>ANDROID_HOME : not set
  </code></pre>
  
  <p>Misc:</p>
  
  <pre><code>backend : pro
  </code></pre>
  
  <p>Please help me to solve this problem.</p>
  
  <p>Thanks in advance.</p>