After building an app and exporting it and an android App. My css is not rendered correctly (basically some css is okay but most of it is not their) given the way the UI is being presented. What can be the issue?
- Are you using a Framework (e.g. Angular, Vue, React)?
- What build tool are you using (e.g. Vite, Webpack)?
- What commands are you running to build and export your app?
I am using angular and for building I am using capacitor.
To build I am using : ionic build - - prod
To export I run the following commands in the given order:
- npx cap sync
- npx cap copy android
- npx cap open android.
- After that I build and export it as an apk
This is typically an issue with Angular with a missing import.
Check if you are importing IonicModule. See Ionic Angular build not building with correct styles to android - #8 by Salil112 and the starter project.
Another issue is if you are using Angular Standalone, importing from @ionic/angular instead of @ionic/angular/standalone.
Let me check it right away. I will revert once I try to rectify the issue by adding Ionic Module if it is missing
Do note that Angular Standalone imports IonApp instead. See starters/angular-standalone/base/src/app/app.component.ts at 356301201df2203a5233ca57a73dca22399407c6 · ionic-team/starters · GitHub
It is surely standalone. And I wasn’t using @ionic/angular/standalone.
I think I should work on this as well