How to refer cordova plugins in $ionicplatform.ready?

So I have added the cordovaarduino plugin using cordova plugin add cordovaarduino and it resides in the plugins directory.

The project root directory

The www directory.

<!DOCTYPE html>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

    <link href="lib/ionic/css/ionic.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/" rel="stylesheet">

    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <!--<script src="cordova.js"></script>-->

    <!-- your app's js -->
    <script src="js/app.js"></script>
  <body ng-app="starter" ng-controller="hostController">
  <div class="offline-outer-wrap">
    <h2>Something Setup</h2>
    <div class="offline-wrap">

app.js$ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
    if(window.StatusBar) {


In the $ionicplatform.ready() , window.cordova is not available nor am I able to access my plugin using the navigator object.

How can I access the plugin and what am I doing wrong?

EDIT: I uncommented the cordova.js import and now I am able to access the plugin, but when I start the app on the android device I am getting alert pop-ups like this : Why is this happening?