App missing "Cordova-plugin-ionic" after Ionic Pro "Deploy" update

I’m trying to set up my app to alert the user when a new update is available via the “Deploy” service, but allow them to choose when to download and install it.

I already have it checking, download, and extracting the update, but I’m running into an error when I try use “Pro.deploy.reloadApp()” to actually install it and reload the app to reflect the updates. Only a white screen appears, and the Chrome remote device console is alerting me “the cordova-plugin-ionic plugin is not installed. Install it for better device information for runtime errors.”

I’m running Ionic v4.0.0beta15 and “cordova-plugin-ionic” v5.2.7, attempting to run this on a Samsung Android tablet running Android 8.0

1 Like

UPDATE:

I’ve gotten past that error by adding to the index.html page, but I’m running into a new problem. The console says that the app has loaded, and “Ionic Native: deviceready event fired after 188 ms”, but the app hangs on the splashscreen. Just a spinning “loading” wheel and nothing actually loading.

I have exactly the same problem, I still use v3… Got any further?

My ionic info:

Ionic:

   ionic (Ionic CLI)  : 4.3.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic 5.2.7, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.3, (and 13 other plugins)

System:

   NodeJS : v11.1.0 (/usr/local/Cellar/node/11.1.0/bin/node)
   npm    : 6.4.1
   OS     : macOS High Sierra
   Xcode  : Xcode 10.1 Build version 10B61

When i restart the app the last output from my console is:

[app-scripts] [13:25:17]  console.log: Current: versionCode: 0.3.0 versionName: 0.3.0 
[app-scripts] [13:25:17]  console.log: update: versionCode: 0.3.0 versionName: 0.3.0

I’ve tested all functions (check, download, extract) and .sync() with same result…

My script at the moment:

// hot-update.ts
  ionViewDidLoad() {
    console.log('ionViewDidLoad HotUpdatePage');
    Pro.deploy
      .configure({
        channel: this.channel
      })
      .then(() => {
        return Pro.deploy.checkForUpdate();
      })
      .then((statusCheck: CheckDeviceResponse) => {
        if(!statusCheck.available) {
          throw new Error('no_available_version');
        }
        this.infotext = 'Downloading...';
        return Pro.deploy.downloadUpdate();
      })
      .then((ok) => {
        if(!ok) {
          throw new Error('download_error');
        }
        console.log('Extracting...');
        this.infotext = 'Extracting...';
        return Pro.deploy.extractUpdate();
      })
      .then((ok) => {
        if(!ok) {
          throw new Error('extract_error');
        }
        console.log('Restaring app...');
        this.infotext = 'Restaring app...';
        setTimeout(() => {
          Pro.deploy.reloadApp();
        }, 3000);
      })
      .catch((err) => {
        if(err.message == 'no_available_version') {
          this.infotext = 'No available version';
        } else if(err.message == 'download_error') {
          this.infotext = 'Download error';
        } else if(err.message == 'extract_error') {
          this.infotext = 'Extract error';
        } else {
          throw err;
        }
      });
  }

Corresponding console:

[app-scripts] [14:16:40]  console.log: ionViewDidLoad HotUpdatePage 
[app-scripts] [14:16:41]  console.log: Starting IonicTimer CleanSnapshotDir 
[app-scripts] [14:16:41]  console.log: No directory found for snapshot no need to delete 
[app-scripts] [14:16:41]  console.log: Finished IonicTimer CleanSnapshotDir in 0.009 seconds. 
[app-scripts] [14:16:41]  console.log: Cleaned version directory 
[app-scripts] [14:16:41]  console.log: Starting IonicTimer CopyBaseApp 
[app-scripts] [14:16:41]  console.log: Finished IonicTimer CopyBaseApp in 0.11 seconds. 
[app-scripts] [14:16:41]  console.log: Copied base app resources 
[app-scripts] [14:16:41]  console.log: Downloading update... 
[app-scripts] [14:16:41]  console.log: Starting IonicTimer downloadTimer 
[app-scripts] [14:16:41]  console.log: About to download 4 new files for update. 
[app-scripts] [14:16:42]  console.log: Message: downloaded batch 0 of 4 downloads Done downloading all 4 files Diff IonicTimer 
[app-scripts]             downloadTimer in 0.819 seconds. 
[app-scripts] [14:16:42]  console.log: Finished IonicTimer downloadTimer in 0.82 seconds. 
[app-scripts] [14:16:42]  console.log: IonicTimer extra Downloaded 4 files 
[app-scripts] [14:16:42]  console.log: Extracting... 
[app-scripts] [14:16:42]  console.log: Restaring app... 

At this stage the app screen is all white… if I restart the app in the simulator It gets stuck at splashscreen with console log:

[app-scripts] [14:30:25]  console.log: Ionic Pro initializing (app id: xxx ) color: blue color: black 
[app-scripts] [14:30:26]  console.log: Constructing auth service 
[app-scripts] [14:30:26]  console.log: rootNav set 
[app-scripts] [14:30:26]  console.log: Angular is running in the development mode. Call enableProdMode() to enable the production 
[app-scripts]             mode. 
[app-scripts] [14:30:26]  console.log: Current: versionCode: 0.3.1 versionName: 0.3.1 
[app-scripts] [14:30:26]  console.log: update: versionCode: 0.3.1 versionName: 0.3.1 

What did you add to the index.html page?

UPDATE:
I just discovered that it works when not using -l -c commands in cordova run

// use:
$ ionic cordova run  ios -- --buildFlag="-UseModernBuildSystem=0"
// instead of
$ ionic cordova run -l -c ios -- --buildFlag="-UseModernBuildSystem=0"