Unable to find source java class while developing plugin for cordova (Android) : <p>I'm developing an plugin to cordova which uses an brazilian payment api called pagseguro. But that's not the point.</p>

<p>When I add my cordova plugin to my project and run "cordova run android", I receive this error and I don't know how to proceed:</p>

<pre><code>Execution failed for task ':app:compileDebugJavaWithJavac'.
</code></pre>

<blockquote>
  <p>Unable to find source java class: '/home/marcelo/Documents/Delicia-e-Foco/app/platforms/android/app/src/main/java/main/java/com/pagseguroCordova/PagseguroCordova.java' because it does not belong to any of the source dirs: '[/home/marcelo/Documents/Delicia-e-Foco/app/platforms/android/app/src/main/java, /home/marcelo/Documents/Delicia-e-Foco/app/platforms/android/app/src/debug/java, /home/marcelo/Documents/Delicia-e-Foco/app/platforms/android/app/build/generated/source/r/debug, /home/marcelo/Documents/Delicia-e-Foco/app/platforms/android/app/build/generated/source/buildConfig/debug, /home/marcelo/Documents/Delicia-e-Foco/app/platforms/android/app/build/generated/source/aidl/debug, /home/marcelo/Documents/Delicia-e-Foco/app/platforms/android/app/build/generated/source/rs/debug]'</p>
</blockquote>

<p>Already tried to modify my plugin.xml. this is the plugin.xml right now:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-plugin-pagseguro"
version="1.0.0"&gt;

&lt;js-module src="./www/plugin.js" name="plugin"&gt;
    emphasized text&lt;clobbers target="PagseguroCordova" /&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="pagseguroCordova" &gt;
            &lt;param name="android-package" value="com.example.pagseguroCordova"/&gt;
        &lt;/feature&gt;
    &lt;/config-file&gt;

    &lt;framework src="build.gradle" custom="true" type="gradleReference" /&gt;
    &lt;framework src='br.uol.pagseguro.client:btserial:1.1.0' /&gt;
    &lt;framework src='br.uol.pagseguro.client:plugpag:1.1.0' /&gt;
    &lt;source-file src="src/android/PagseguroCordova.java" target-dir="src/main/java/com/pagseguroCordova/" /&gt;
&lt;/platform&gt;
</code></pre>

<p>I'm using gradle to import dependecies, this is my build.gradle file: </p>

<pre><code>repositories {
    jcenter()
        maven {
            url 'https://github.com/pagseguromaster/plugpag/raw/master/android'
    }
}

dependencies {
    compile 'br.uol.pagseguro.client:btserial:1.1.0'
    compile 'br.uol.pagseguro.client:plugpag:1.1.0'
}
</code></pre>

<p>Someone knows what is causing this error? Thanks for the attention. </p>
