title: Ionic 4: Cordova is not available. Make sure to include cordova.js or run in a device/simulator
body: <p>I am trying to use the cordova plugin in a new ionic 4 project  but I always run into errors regarding cordova. The plugin is properly installed and shows up in the plugin folder.</p>
  
  <p><strong>Error</strong></p>
  
  <p>Native: tried calling SplashScreen.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator </p>
  
  <p><strong>home.page.html</strong></p>
  
  <pre><code>&lt;ion-header&gt;
    &lt;ion-toolbar&gt;
      &lt;ion-title&gt;
        Ionic Blank
      &lt;/ion-title&gt;
    &lt;/ion-toolbar&gt;
  &lt;/ion-header&gt;
  
  &lt;ion-content&gt;
    &lt;ion-button expand="full" (click)="openLocalPdf()"&gt;Open Local PDF&lt;/ion-button&gt;
    &lt;ion-button expand="full" (click)="downloadAndOpenPdf()"&gt;Download and open PDF&lt;/ion-button&gt;
  &lt;/ion-content&gt;
  </code></pre>
  
  <p><strong>home.page.ts</strong></p>
  
  <pre><code>import { Platform } from '@ionic/angular';
  import { File } from '@ionic-native/File/ngx';
  import { Component } from '@angular/core';
  import { FileOpener } from '@ionic-native/file-opener/ngx';
  import { DocumentViewer, DocumentViewerOptions } from '@ionic-native/document-viewer/ngx';
  import { FileTransfer } from '@ionic-native/file-transfer/ngx';
  
  @Component({
    selector: 'app-home',
    templateUrl: 'home.page.html',
    styleUrls: ['home.page.scss'],
  })
  export class HomePage {
    constructor(private platform: Platform, private file: File, private ft: FileTransfer,
                private fileOpener: FileOpener, private document: DocumentViewer, ) {
  
    }
    openLocalPdf() {
          const filePath = this.file.applicationDirectory + 'www/assets';
  
          if (this.platform.is('android')) {
        const fakeName = Date.now();
        this.file.copyFile(filePath, '5-tools.pdf', this.file.dataDirectory, `${fakeName}.pdf`).then(result =&gt; {
          this.fileOpener.open(result.nativeURL, 'application/pdf')
            .then(() =&gt; console.log('File is opened'))
            .catch(e =&gt; console.log('Error opening file', e));
        });
      } else {
        // Use Document viewer for iOS for a better UI
        const options: DocumentViewerOptions = {
          title: 'My PDF'
        };
        this.document.viewDocument(`${filePath}/5-tools.pdf`, 'application/pdf', options);
      }
    }
  
    downloadAndOpenPdf() {
      const downloadUrl = 'https://devdactic.com/html/5-simple-hacks-LBT.pdf';
      const path = this.file.dataDirectory;
      const transfer = this.ft.create();
  
      transfer.download(downloadUrl, path + 'myfile.pdf').then(entry =&gt; {
        const url = entry.toURL();
  
        if (this.platform.is('ios')) {
          this.document.viewDocument(url, 'application/pdf', {});
        } else {
          this.fileOpener.open(url, 'application/pdf')
            .then(() =&gt; console.log('File is opened'))
            .catch(e =&gt; console.log('Error opening file', e));
        }
      });
    }
  }
  </code></pre>