Capacitor: this.platform.ready() not firing in production?


I’m having a very strange issue. I have code in my initializeApp() method that takes care of some configurations like ignoring native font zooming, disabling screen rotation, some statusbar configurations, etc. I’m also fetching some data from my backend.

When I open the app on my physical android device after running ‘ionic cap sync’ everything works fine. But after bundling my app and publishing it in the PlayStore nothing happens on the same device. No splashscreen, no data, no configurations, nothing. It seems like the function is getting ignored? I have no clue why. Here is the code in initializeApp():

initializeApp(): void {
      this.platform.ready().then(async () => {
         if (this.platform.width() > 500) {
            this.usingLargeDevice = true;


         const info = await Device.getInfo();

         if (info.platform !== 'web') {
            const hasCompletedTutorial = await this.appSettingsService.hasCompletedTutorial();
            if (!hasCompletedTutorial) {

            if (!await this.appSettingsService.isReloadingAppAfterExitingTutorial()) {
               // show custom splashscreen
               this.showingSplash = true;

            // disable screen rotation

            // ignore native font zooming

               overlay: true
               style: StatusBarStyle.Light

            this.oneSignal.startInit(environment.oneSignal.appId, environment.oneSignal.googleProjectNumber);

            // hide default splashscreen

            // hide custom splashscreen after 3 seconds
            timer(3000).subscribe(() => {
               this.showingSplash = false;


Thanks in advance!


Added some toasts to test the signed apk. It seems like the ‘this.platform.ready().then(async () => {}’ is never hit after signing the app. Any suggestions?

Found the problem. I was using minify, guess I can’t do that.

I believe there are no functions “platform ready” with capacitor.
Try to launch app in prod mode on your Android. And inspect with chrome://inspect/#devices

ionic capacitor build android--prod

Real root of the issue is probably mixing both promises and async await without actually returning the original promise from platform.ready()

Idk, my hardware backbutton wasn’t working either. After disabling minify the app worked as expected. The async await functionality is being used in the callback of the platform.ready(). Can you explain what’s wrong with that approach?

  async initializeApp(): void {
    await this.platform.ready();

You can simplify your code by using async await automatically. Minification is probably showing/hiding the error because of how async/await and promises can get rewritten during minification.

Also, there’s an unnecessary subscription in there

    timer(3000).subscribe(() => {
               this.showingSplash = false;

Since this is never unsubscribed to, it will cause a memory leak. Just use setTimeout instead.