melix / speakertime

A demo project for Groovy and Android, as seen in Devoxx
20 stars 1 forks source link

trying to get this working with latest android studio..... #1

Open rvanderwerf opened 9 years ago

rvanderwerf commented 9 years ago

I seem to be getting this error all over the place. I assume something has changed since feb with the tools:

:wear:lint FAILED

FAILURE: Build failed with an exception.

Ran lint on variant release: 26 issues found Ran lint on variant debug: 26 issues found Wrote HTML report to file:/home/rvanderwerf/github/speakertime/wear/build/outputs/lint-results.html Wrote XML report to /home/rvanderwerf/github/speakertime/wear/build/outputs/lint-results.xml :wear:lint FAILED

InvalidPackage: Package not included in Android ../../../../../.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.0/341909a61c1d9bd25ead469dbe7d23a4542d14e5/groovy-2.4.0-grooid.jar: Invalid package reference in library; not included in Android: java.applet. Referenced from groovyjarjaropenbeans.Beans. ../../../../../.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.0/341909a61c1d9bd25ead469dbe7d23a4542d14e5/groovy-2.4.0-grooid.jar: Invalid package reference in library; not included in Android: java.awt.event. Referenced from groovyjarjarantlr.debug.misc.ASTFrame.1. ../../../../../.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.0/341909a61c1d9bd25ead469dbe7d23a4542d14e5/groovy-2.4.0-grooid.jar: Invalid package reference in library; not included in Android: java.awt. Referenced from groovyjarjarantlr.debug.misc.ASTFrame. ../../../../../.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.0/341909a61c1d9bd25ead469dbe7d23a4542d14e5/groovy-2.4.0-grooid.jar: Invalid package reference in library; not included in Android: java.lang.invoke. Referenced from org.codehaus.groovy.classgen.asm.indy.InvokeDynamicWriter. ../../../../../.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.0/341909a61c1d9bd25ead469dbe7d23a4542d14e5/groovy-2.4.0-grooid.jar: Invalid package reference in library; not included in Android: javax.swing.event. Referenced from groovyjarjarantlr.debug.misc.ASTFrame.MyTreeSelectionListener. ../../../../../.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.0/341909a61c1d9bd25ead469dbe7d23a4542d14e5/groovy-2.4.0-grooid.jar: Invalid package reference in library; not included in Android: javax.swing.text. Referenced from org.codehaus.groovy.antlr.LexerFrame. ../../../../../.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.0/341909a61c1d9bd25ead469dbe7d23a4542d14e5/groovy-2.4.0-grooid.jar: Invalid package reference in library; not included in Android: javax.swing.tree. Referenced from groovyjarjarantlr.debug.misc.ASTFrame.MyTreeSelectionListener. ../../../../../.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.0/341909a61c1d9bd25ead469dbe7d23a4542d14e5/groovy-2.4.0-grooid.jar: Invalid package reference in library; not included in Android: javax.swing. Referenced from groovyjarjarantlr.debug.misc.ASTFrame. Priority: 6 / 10 Category: Correctness Severity: Error Explanation: Package not included in Android. This check scans through libraries looking for calls to APIs that are not included in Android.

When you create Android projects, the classpath is set up such that you can only access classes in the API packages that are included in Android. However, if you add other projects to your libs/ folder, there is no guarantee that those .jar files were built with an Android specific classpath, and in particular, they could be accessing unsupported APIs such as java.applet.

This check scans through library jars and looks for references to API packages that are not included in Android and flags these. This is only an error if your code calls one of the library classes which wind up referencing the unsupported package.

More info:

To suppress this error, use the issue id "InvalidPackage" as explained in the Suppressing Warnings and Errors section.

Sarev0k commented 9 years ago

I'm running into this as well.

Looks like there's an issue created for it here: https://issues.apache.org/jira/browse/GROOVY-7296

@melix Is this a difficult problem to fix? If you could provide any pointers as to where you think the problem lies and how you would like the solution tested, I could try creating a patch for this.

EdwardIII commented 9 years ago

Is there a workaround for this currently? Running into the same issue here.

melix commented 9 years ago

I'm not sure we can solve this easily. While we can exclude some classes from Groovy, the errors you see here are from dependencies of Groovy (openbeans) that implement some missing features of Android. It should be possible to exclude the checks in lint as a temporary workaround.