title: Phonegap 3 Plugin causing build error or plugin not initialized
body: <p>Let me start with some context. I have a Java file and a .jar library which contains an Android project with an Activity, its layout, and another jar library. I also have the javascript interface for my plugin, of course. In other words, this is what I have:</p>
  
  <pre><code>plugins/com.phonegap.example.activity.plugin/www/myplugin.js
  plugins/com.phonegap.example.activity.plugin/src/android/MyPlugin.java
  plugins/com.phonegap.example.activity.plugin/src/android/libs/myJar.jar
  plugins/plugin.xml
  </code></pre>
  
  <p>My plugin is supposed to execute a method within my <em>MyPlugin.java</em> file which is supposed to then launch the Activity that is within the <em>myJar.jar</em> file.
  The plugin.xml for this plugin reads:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
         id="com.phonegap.example.activity.plugin"
    version="0.1.0"&gt;
  &lt;name&gt;MyPlugin&lt;/name&gt;
  &lt;description&gt;Launch an Android Activity from PhoneGap 3&lt;/description&gt;
  &lt;author&gt;Author&lt;/author&gt;
  &lt;license&gt;MIT&lt;/license&gt;
  &lt;keywords&gt;phonegap,activity&lt;/keywords&gt;
  
  &lt;js-module src="www/myplugin.js" name="MyPlugin"&gt;
          &lt;clobbers target="window.MyPlugin" /&gt;
  &lt;/js-module&gt;
  
  &lt;!-- android --&gt;
  &lt;platform name="android"&gt;
      &lt;config-file target="res/xml/config.xml" parent="/*"&gt;
          &lt;feature name="MyPlugin"&gt;
              &lt;param name="android-package" value="com.phonegap.example.activity.plugin"/&gt;
          &lt;/feature&gt;
      &lt;/config-file&gt;
      &lt;config-file target="AndroidManifest.xml" parent="/*"&gt;
          &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
          &lt;activity 
              android:name="com.phonegap.example.activity.ExampleActivity" 
              android:label="@string/app_name"&gt;
                  &lt;intent-filter&gt;
                      &lt;action android:name="com.phonegap.example.action.EXAMPLE" /&gt;
                  &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/config-file&gt;
      &lt;source-file src="src/android/MyPlugin.java" target-dir="src/com/phonegap/example/activity" /&gt;
      &lt;source-file src="src/android/libs/myJar.jar" target-dir="libs" /&gt;
   &lt;/platform&gt;          
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I have installed Phonegap 3.3 and Cordova 3.4 using <code>npm install</code>, and I have Ruby 2.0.0 installed as well. I'm running all this on a Mac OS X.</p>
  
  <p>Onto the problem:</p>
  
  <ol>
  <li>I create a phonegap app to test this plugin (<code>phonegap create TestApp</code>)</li>
  <li>I add the Android platform (<code>cordova platform add android</code>)</li>
  <li>I run <code>phonegap local plugin add /path/to/plugin/folder</code> from within my newly created app</li>
  <li><p>I run <code>phonegap build android</code> and the compile fails with the following error:</p>
  
  <p>[error] An error occurred while building the android project. Error executing "ant debug -f "/path/to/TestApp/platforms/android/build.xml"":
  BUILD FAIL
  /path/to/ant/build.xml:720: The following error occurred while executing this line:
  /path/to/ant/build.xml:734: Compile failed; see the compiler error output for details.</p>
  
  <p>Total time: 4 seconds</p></li>
  </ol>
  
  <p>I don't understand why this is happening at all. When I install the plugin it seems like it's been added successfully and it appears within the <code>plugins/android.json</code> file.</p>
  
  <p>At one point, the project automagically decided to compile properly (I don't know what made it work). I tried to access the plugin I had added by adding a line that reads <code>var p = window.MyPlugin</code> within the <code>www/js/index.js</code>, right after the <code>app.receivedEvent('deviceready');</code> in the <code>onDeviceReady</code> function. I used <code>console.log(p);</code>  and it turned out to be undefined, as if my plugin had never been loaded/initialized in the first place.</p>
  
  <p>I suppose this is a problem within my plugin definition, since the Java part has been tested on an Android native app and it was working properly. Where did I go wrong with my plugin? What can I do to troubleshoot it? Why wasn't it initialized? Any help/guidance is very well-appreciated.</p>
  
  <p><strong>======UPDATE=====</strong></p>
  
  <p>I followed Dawson's suggestion to use <code>cordova build android -d</code> and here's the output I received:</p>
  
  <pre><code>[javac] /path/to/TestApp/platforms/android/src/com/phonegap/example/MyPlugin.java:10: 
      error: package com.phonegap.example.activity does not exist
  [javac] import com.phonegap.example.activity.ExampleActivity;
  </code></pre>
  
  <p>This com.phonegap.example.activity package is defined within the <code>myJar.jar</code> file, so it seems that <code>MyPlugin.java</code> can't find the <code>myJar.jar</code> file.
  I think the <code>plugin.xml</code> should be correctly taking care of the including the jar file during plugin installation. This is how it's being added in the <code>plugin.xml</code>:</p>
  
  <pre><code> &lt;source-file src="src/android/libs/myJar.jar" target-dir="libs" /&gt;
  </code></pre>
  
  <p>Any ideas of what may be wrong here?</p>