Note that there are some explanatory texts on larger screens.

plurals
  1. PONetBeans does not recognize classes in apklib (ActionBarSherlock for instance)
    text
    copied!<p>I'm working on an Android app in NetBeans 7.3 (because it's my preferred IDE). It's a Maven project, it has a dependency on <a href="http://actionbarsherlock.com/usage.html" rel="nofollow">ActionBarSherlock</a> and I'm using the android-maven-plugin.</p> <p>My POM is similar to this one:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;parent&gt; &lt;groupId&gt;amnl.example&lt;/groupId&gt; &lt;artifactId&gt;android-parent&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;/parent&gt; &lt;groupId&gt;amnl.example&lt;/groupId&gt; &lt;artifactId&gt;android-app&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;apk&lt;/packaging&gt; &lt;name&gt;Yet Another Android App&lt;/name&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;com.google.android&lt;/groupId&gt; &lt;artifactId&gt;android&lt;/artifactId&gt; &lt;version&gt;4.1.1.4&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.actionbarsherlock&lt;/groupId&gt; &lt;artifactId&gt;actionbarsherlock&lt;/artifactId&gt; &lt;version&gt;4.3.1&lt;/version&gt; &lt;type&gt;apklib&lt;/type&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;junit&lt;/groupId&gt; &lt;artifactId&gt;junit&lt;/artifactId&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;build&gt; &lt;finalName&gt;${project.artifactId}&lt;/finalName&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;!-- use the copy resources instead of resources, which adds it to the eclipse buildpath --&gt; &lt;phase&gt;initialize&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;copy-resources&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;outputDirectory&gt;${project.basedir}/res&lt;/outputDirectory&gt; &lt;resources&gt; &lt;resource&gt; &lt;directory&gt;${project.basedir}/src/templates/res&lt;/directory&gt; &lt;targetPath&gt;${project.basedir}/res&lt;/targetPath&gt; &lt;filtering&gt;true&lt;/filtering&gt; &lt;/resource&gt; &lt;/resources&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt; &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt; &lt;extensions&gt;true&lt;/extensions&gt; &lt;configuration&gt; &lt;sdk&gt; &lt;platform&gt;16&lt;/platform&gt; &lt;/sdk&gt; &lt;manifest&gt; &lt;debuggable&gt;true&lt;/debuggable&gt; &lt;/manifest&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;manifestUpdate&lt;/id&gt; &lt;phase&gt;process-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;manifest-update&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;alignApk&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;zipalign&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;profiles&gt; &lt;profile&gt; &lt;id&gt;release&lt;/id&gt; &lt;!-- via this activation the profile is automatically used when the release is done with the maven release plugin --&gt; &lt;activation&gt; &lt;property&gt; &lt;name&gt;performRelease&lt;/name&gt; &lt;value&gt;true&lt;/value&gt; &lt;/property&gt; &lt;/activation&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-jarsigner-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;signing&lt;/id&gt; &lt;goals&gt; &lt;goal&gt;sign&lt;/goal&gt; &lt;goal&gt;verify&lt;/goal&gt; &lt;/goals&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;inherited&gt;true&lt;/inherited&gt; &lt;configuration&gt; &lt;removeExistingSignatures&gt;true&lt;/removeExistingSignatures&gt; &lt;archiveDirectory /&gt; &lt;includes&gt; &lt;include&gt;${project.build.directory}/${project.artifactId}.apk&lt;/include&gt; &lt;/includes&gt; &lt;keystore&gt;${sign.keystore}&lt;/keystore&gt; &lt;alias&gt;${sign.alias}&lt;/alias&gt; &lt;storepass&gt;${sign.storepass}&lt;/storepass&gt; &lt;keypass&gt;${sign.keypass}&lt;/keypass&gt; &lt;verbose&gt;false&lt;/verbose&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;!-- the signed apk then needs to be zipaligned and we activate proguard and we run the manifest update --&gt; &lt;plugin&gt; &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt; &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt; &lt;inherited&gt;true&lt;/inherited&gt; &lt;configuration&gt; &lt;release&gt;true&lt;/release&gt; &lt;sign&gt; &lt;debug&gt;false&lt;/debug&gt; &lt;/sign&gt; &lt;zipalign&gt; &lt;skip&gt;false&lt;/skip&gt; &lt;verbose&gt;true&lt;/verbose&gt; &lt;inputApk&gt;${project.build.directory}/${project.artifactId}.apk&lt;/inputApk&gt; &lt;outputApk&gt;${project.build.directory}/${project.artifactId}-signed-aligned.apk &lt;/outputApk&gt; &lt;/zipalign&gt; &lt;manifest&gt; &lt;debuggable&gt;false&lt;/debuggable&gt; &lt;versionCodeAutoIncrement&gt;true&lt;/versionCodeAutoIncrement&gt; &lt;/manifest&gt; &lt;!-- Change to true to skip Proguard --&gt; &lt;proguard&gt; &lt;skip&gt;false&lt;/skip&gt; &lt;/proguard&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;manifestUpdate&lt;/id&gt; &lt;phase&gt;process-resources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;manifest-update&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;alignApk&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;zipalign&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;artifacts&gt; &lt;artifact&gt; &lt;file&gt;${project.build.directory}/${project.artifactId}-signed-aligned.apk&lt;/file&gt; &lt;type&gt;apk&lt;/type&gt; &lt;classifier&gt;signed-aligned&lt;/classifier&gt; &lt;/artifact&gt; &lt;artifact&gt; &lt;file&gt;${project.build.directory}/proguard/mapping.txt&lt;/file&gt; &lt;type&gt;map&lt;/type&gt; &lt;classifier&gt;release&lt;/classifier&gt; &lt;/artifact&gt; &lt;/artifacts&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;attach-signed-aligned&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;attach-artifact&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; &lt;/profiles&gt; &lt;/project&gt; </code></pre> <p>Everything works fine until I actual want to use the ActionBarSherlock library. NetBeans does not seem to recognize the classes in the apklib (for example <code>com.actionbarsherlock.app.SherlockActivity</code>). I can find the apklib in the tree structure of the project in NetBeans, but it's filed under Non-classpath Dependencies. It does recognize the generated sources of the library (like <code>com.actionbarsherlock.R</code>).</p> <p>How can I fix this, so that NetBeans does not complain about classes not being found and so that auto-completion works for these classes?</p> <p>I tried several possible workarounds (<a href="http://kinetikmobi.wordpress.com/2011/12/20/classes-inside-apklib-not-showing-up-in-netbeans/" rel="nofollow">1</a>, <a href="https://code.google.com/p/maven-android-plugin/issues/detail?id=139#c4" rel="nofollow">2</a>, <a href="https://code.google.com/p/maven-android-plugin/issues/detail?id=139#c6" rel="nofollow">3</a>), but they were not working for me. Also I'm pretty sure <a href="https://netbeans.org/bugzilla/show_bug.cgi?id=220446" rel="nofollow">NetBeans bug 220446</a> is related</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload