Home > database >  my ionic app turned to a black background on android
my ionic app turned to a black background on android

Time:03-02

I built my app, using the default "ionic start" command. I chose "blank" app and if I test on browser, background is white, but if I test the same blank app, on my android phone using "ionic cordova run android" the app background is black. Why?

CodePudding user response:

I had the same problem and I solved it like this.

  1. Open theme/variable.scss
  2. Search @media (prefers-color-scheme: dark) and replace by @media (prefers-color-scheme: primary)

CodePudding user response:

Latest ionic update has theme related conflicts in latest android versions (not sure).
My solution-

  1. Open theme/variables.scss inside your project.
  2. Search for "dark" and you will find something like @media..dark..
  3. Comment out the whole block related to dark.
  4. Open index.html and search 'light dark'. Remove the 'dark' and rebuild the app.
  5. Now your app uses correct colors.
  • Related