F
F
fredrsf2014-02-22 13:28:03
Android
fredrsf, 2014-02-22 13:28:03

How to connect guava in android studio?

Can't include guava library in Android Studio. Listing build.gradle :

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.8.+'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
    dependencies {
        compile group: 'com.google.guava', name: 'guava', version: '15.0'
    }
}

Why am I getting the error
A problem occurred evaluating root project 'Test'.
> No signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.compile() is applicable for argument types: (java.util.LinkedHashMap) values: 
Possible solutions: module(java.lang.Object)

How to include this library correctly? Tried many ways from google...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
fredrsf, 2014-02-22
@fredrsf

I don’t know if the path is right, but it just happened like this: I downloaded the .jar file from here search.maven.org/#artifactdetails%7Ccom.google.gua... then threw it into the libs folder, then right-clicked on this .jar and add library

F
fredrsf, 2014-02-22
@fredrsf

This is completely removed

dependencies {
        compile group: 'com.google.guava', name: 'guava', version: '15.0'
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question