Imposible to create an apk in ionik

I can not create any apk in ionic. I have installed the last version of ionic, cordova, sdk, node. The problem persists when I try to run any of my apps.
I write : ionic cordova run android --prod --release

the shown error ;


            E:/ionic/FireDato/src/app/app.module.ts and EdicionPageModule in
            E:/ionic/FireDato/src/pages/edicion/edicion.module.ts. You can also create a new NgModule that exports and
            includes EdicionPage in E:/ionic/FireDato/src/pages/edicion/edicion.ts then import that NgModule in
            AppModule in E:/ionic/FireDato/src/app/app.module.ts and EdicionPageModule in
            E:/ionic/FireDato/src/pages/edicion/edicion.module.ts.

[19:07:31]  ionic-app-script task: "build"
[19:07:31]  Error: The Angular AoT build failed. See the issues above
Error: The Angular AoT build failed. See the issues above
    at E:\ionic\FireDato\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:237:55
    at step (E:\ionic\FireDato\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:32:23)
    at Object.next (E:\ionic\FireDato\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:13:53)
    at fulfilled (E:\ionic\FireDato\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:4:58)
[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.

Does the issue occur when you do a build without those flags. The error message is pointing to an issue with your modules. Can you run your app with just ionic serve?

It’s an AoT build error, normally you should be able to build your app without the —prod flag.

Can you post the complete error message related to the .ts files?

Sounds like you have a page that is trying to be both eagerly loaded (live in the app module) and lazily loaded (live in its own module). Can’t do both; pick one. If you don’t know which to pick, my recommendation is eager.

Hi Hariman.
firstly, thank you for your help.
After re-installing ionic, cordova and node again. Everything works.

I have another problem with my app. I can add item to my firebase, but I can not edit any item from firebase.

1 Like

Thank you rapropos.
It works again. I do not understand when you say you recom me the eager.

Thank you ChrisGriiffith.
It works again.

Hi.
I have the error I posted in this page.

I can run my app with ionic serve.
I build the app , but this second time I added firebase and I can not build it again.
ERROR] An error occurred while running subprocess ionic-app-scripts.