title: Why Ionic 4 Framwork is not able to create an apk?
body: <p>Hi I have used <code>ionic cordova build android --prod --release</code> this command for generating APK in Ionic 4 but I am getting error like this </p>
  
  <p><a href="https://i.stack.imgur.com/A85fd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A85fd.png" alt="enter image description here"></a></p>
  
  <p>This is the code in the <strong>app.module.ts</strong> as the error is shown here only.</p>
  
  <pre><code>import { NgModule, ErrorHandler } from '@angular/core';
  import { BrowserModule } from '@angular/platform-browser';
  import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
  import { MyApp } from './app.component';
  import { HomePage } from '../pages/home/home';
  import { CategoryPage } from '../pages/category/category';
  import { CustomPage } from '../pages/custom/custom';
  import { NewstuffPage } from '../pages/newstuff/newstuff'
  import { ChinesePage } from '../pages/chinese/chinese';
  import { ItalianPage } from '../pages/italian/italian';
  import { MexicanPage } from '../pages/mexican/mexican';
  
  import { StatusBar } from '@ionic-native/status-bar';
  import { SplashScreen } from '@ionic-native/splash-screen';
  
  @NgModule({
    declarations: [
        MyApp
    ],
    imports: [
      BrowserModule,
      CategoryPage,
      HomePage,
       CustomPage,
       ChinesePage,
        ItalianPage,
         MexicanPage,
         NewstuffPage,
      IonicModule.forRoot(MyApp)
    ],
    bootstrap: [IonicApp],
    entryComponents: [
      MyApp,
      CategoryPage,
      HomePage,
       CustomPage,
       ChinesePage,
        ItalianPage,
         MexicanPage,
         NewstuffPage
    ],
    providers: [
      StatusBar,
      SplashScreen,
      {provide: ErrorHandler, useClass: IonicErrorHandler}
    ]
  })
  export class AppModule {}
  </code></pre>
  
  <p>Output what I get in command prompt</p>
  
  <pre><code>C:\onlinefood&gt;ionic cordova build android --prod --release
  &gt; ionic-app-scripts build --prod --target cordova --platform android
  [16:18:00]  ionic-app-scripts 3.2.0
  [16:18:00]  build prod started ...
  [16:18:00]  clean started ...
  [16:18:00]  clean finished in 3 ms
  [16:18:00]  copy started ...
  [16:18:01]  deeplinks started ...
  [16:18:01]  deeplinks finished in 71 ms
  [16:18:01]  ngc started ...
  [16:18:16]  typescript error
              Unexpected directive 'CategoryPage in C:/onlinefood/src/pages/category/category.ts' imported by the module
              'AppModule in C:/onlinefood/src/app/app.module.ts'. Please add a @NgModule annotation.
  
  [16:18:16]  ionic-app-script task: "build"
  [16:18:16]  Error: The Angular AoT build failed. See the issues above
  Error: The Angular AoT build failed. See the issues above
      at C:\onlinefood\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:237:55
      at step (C:\onlinefood\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:32:23)
      at Object.next (C:\onlinefood\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:13:53)
      at fulfilled (C:\onlinefood\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:4:58)
      at &lt;anonymous&gt;
  [ERROR] An error occurred while running subprocess ionic-app-scripts.
  
          ionic-app-scripts build --prod --target cordova --platform android exited with exit code 1.
  
          Re-running this command with the --verbose flag may provide more information.
  </code></pre>
  
  <p>Thanks in advance for solving my problem.</p>