Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

plugin breaks lint on new versions of android plugin #33

Closed
andaag opened this issue Dec 3, 2014 · 6 comments
Closed

plugin breaks lint on new versions of android plugin #33

andaag opened this issue Dec 3, 2014 · 6 comments

Comments

@andaag
Copy link

andaag commented Dec 3, 2014

Hi

See this thread : https://groups.google.com/forum/#!topic/adt-dev/ezM6RmO_ADY

We tracked it down to this plugin. If we remove that lint works fine.

@roman-mazur
Copy link
Contributor

As you can see in build.gradle we do not have a direct dependency on guava.
Here is a piece of runtime deps report.

runtime - Runtime classpath for source set 'main'.
+--- com.squareup.spoon:spoon-runner:1.1.2
|    +--- com.android.tools.ddms:ddmlib:23.2.1
|    |    \--- com.android.tools:common:23.2.1
|    |         \--- com.google.guava:guava:17.0 -> 18.0
|    +--- com.github.spullara.mustache.java:compiler:0.8.14
|    |    \--- com.google.guava:guava:13.0.1 -> 18.0
|    +--- com.google.guava:guava:18.0
\--- com.android.tools.build:gradle:0.14.1
     +--- com.android.tools.lint:lint:23.2.1
     |    +--- org.eclipse.jdt.core.compiler:ecj:4.2.2
     |    \--- com.android.tools.lint:lint-checks:23.2.1
     |         +--- com.android.tools.lint:lint-api:23.2.1
     |         |    +--- com.android.tools.external.lombok:lombok-ast:0.2.2
     |         |    |    \--- com.google.guava:guava:15.0 -> 18.0

Looks like Android Lint relies on guava 15.0.
But spoon-runner has a dep on 18.0, which causes the conflict and crash.

@roman-mazur
Copy link
Contributor

I see the following exception

Caused by: java.lang.NoSuchMethodError: com.google.common.io.Files.newOutputStreamSupplier(Ljava/io/File;)Lcom/google/common/io/OutputSupplier;
    at com.android.tools.lint.checks.ApiLookup.writeDatabase(ApiLookup.java:611)

This means that lint directly uses guava in ApiLookup method. However, there is not guava in their pom file.

@roman-mazur
Copy link
Contributor

My current workaround is

    classpath('com.stanfy.spoon:spoon-gradle-plugin:0.14.1') {
      exclude module: 'guava'
    }
    classpath 'com.google.guava:guava:17.0'

With this configuration

gradle clean lint spoon

works for example in this repo.

@andaag please close if it works for you

@andaag
Copy link
Author

andaag commented Dec 3, 2014

Works! Might be worth it to update the Readme.md or the sample, I'd imagine other people might run into this as well :)

Thank you very much for your help :)

@andaag andaag closed this as completed Dec 3, 2014
@roman-mazur
Copy link
Contributor

README updated in de86098.

@pvegh
Copy link

pvegh commented Jan 20, 2015

When using the workaround above (which fixes the lint issue), Spoon does not work anymore with multiple devices are attached. One device still works though.

More info at #36

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants