Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

build.gradle: unable to resolve class com.google.common.collect.ImmutableMap

1,477 views
Skip to first unread message

Hans-Christoph Steiner

unread,
Dec 22, 2016, 6:40:02 PM12/22/16
to

I'm trying to update the Android gradle plugin (java/groovy/gradle) to
the latest release in time for stretch. I already updated the dependent
lib android-platform-frameworks-data-binding to 2.2.2 and uploaded that.
Seamlik uploaded
android-platform-tools-analytics-library and this is already using that.
Now I'm stumped by a build.gradle that is importing a Java class from
libguava, but its not being found. This advanced gradle is a bit beyond
me. My work is all current in their respective git repos.

android-platform-tools-base:

import com.google.common.collect.ImmutableMap

apply plugin: 'java'
apply plugin: 'jacoco'
[snip]


Here's the stacktrace:

[snip]
Caused by:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed:
build file
'/export/share/code/android-tools/android-platform-tools-base/sdklib/build.gradle':
1: unable to resolve class com.google.common.collect.ImmutableMap
@ line 1, column 1.
import com.google.common.collect.ImmutableMap
^

1 error

at
org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileScript(DefaultScriptCompilationHandler.java:129)
... 96 more


BUILD FAILED

殷啟聰

unread,
Dec 23, 2016, 5:30:02 AM12/23/16
to
Add the following to the beginning of "build.gradle":

```
buildscript {
dependencies {
compile 'com.google.guava:guava:debian'
}
}
```

And see what happens :)
> _______________________________________________
> Android-tools-devel mailing list
> Android-t...@lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/android-tools-devel

Hans-Christoph Steiner

unread,
Dec 23, 2016, 6:30:02 AM12/23/16
to

This fixed in it in the end:

buildscript {
dependencies {
classpath 'com.google.guava:guava:debian'
}
}

.hc

殷啟聰:
0 new messages