title: Unable to add a cordova plugin from local folder
body: <p>I am creating a sample app in Ionic. On adding a cordova plugin to my app from local folder I get below error:</p>
  
  <blockquote>
    <p>cordova plugin add ../local-cordova-plugin --save<br>
    ✖ Running command - failed!<br>
    [ERROR] An error occurred while running cordova plugin add ../local-cordova-plugin --save (exit code 1):<br>
    Error: Failed to get absolute path to installed module</p>
  </blockquote>
  
  <p><strong>Note</strong>: This error occurs if I add it after I have added plugins from npm repository or adding any platform to my app. If I add it first, before adding any other plugin or platform, it gets added successfully.</p>
  
  <p><strong>Steps to reproduce:</strong></p>
  
  <p><code>$ ionic cordova plugin add ../local-cordova-plugin</code> </p>
  
  <p><strong>Note</strong>: Add the local cordova plugin after adding a platform or a plugin from npm repository to your ionic app.</p>
  
  <p><strong>Other information:</strong>
  There is a <a href="https://stackoverflow.com/questions/43856285/failed-to-get-absolute-path-to-installed-module">similar issue</a> posted but it didn't resolve my issue. I have used flags like <code>--nofetch, --force, --noregistry, --searchpath</code> but of no help. </p>
  
  <p><strong>Ionic info:</strong> </p>
  
  <p>```
  cli packages: (/usr/local/lib/node_modules)</p>
  
  <pre><code>@ionic/cli-utils  : 1.9.2
  ionic (Ionic CLI) : 3.9.2
  </code></pre>
  
  <p>global packages:</p>
  
  <pre><code>Cordova CLI : 7.0.1 
  </code></pre>
  
  <p>local packages:</p>
  
  <pre><code>@ionic/app-scripts : 2.1.3
  Cordova Platforms  : android 6.2.3
  Ionic Framework    : ionic-angular 3.6.0
  </code></pre>
  
  <p>System:</p>
  
  <pre><code>Android SDK Tools : 26.0.2
  Node              : v7.0.0
  npm               : 3.10.8 
  OS                : macOS Sierra
  </code></pre>
  
  <p><strong>Update</strong>: plugin.xml of my local-cordova-plugin (as requested by @MaximShoustin)</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;plugin id="com.local.cordova" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;name&gt;local_plugin&lt;/name&gt;
    &lt;js-module name="local_plugin" src="www/local_plugin.js"&gt;
      &lt;clobbers target="local" /&gt;
    &lt;/js-module&gt;
    &lt;platform name="android"&gt;
      &lt;config-file parent="/*" target="res/xml/config.xml"&gt;
        &lt;feature name="local_plugin"&gt;
          &lt;param name="android-package" value="com.local.cordova.local_plugin" /&gt;
        &lt;/feature&gt;
      &lt;/config-file&gt;
          &lt;config-file parent="/*" target="AndroidManifest.xml"&gt;
      &lt;/config-file&gt;
      &lt;source-file src="src/android/local_plugin.java" target-dir="src/com/local/cordova/local_plugin" /&gt;
      &lt;resource-file src="local-release/local-1.0.0-release.aar" target="libs/local-1.0.0-release.aar" /&gt;
      &lt;edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge"&gt;
          &lt;uses-sdk android:minSdkVersion="19" /&gt;
      &lt;/edit-config&gt;
    &lt;/platform&gt;
  &lt;/plugin&gt;
  </code></pre>