Mateus Barbosa Mateus Barbosa - 1 year ago 108
Android Question

RestTemplate Spring is not showing in android

I'm trying to make my application get some data from a WebApi, so I added

compile 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M3'

to my Gradle and Sync with the project, but when I tried to declare my
RestTemplate restTemplate = new RestTemplate();
, it just show that it cannot resolve the symbol "RestTemplate" and there's no error message at all but this. Have I done something wrong? Anyone knows why is that happening?

Answer Source

Just to add a more complete answer, the following code is the one I'm using:

android { 
    // Default code...

    repositories {
        maven {
            url ''
    packagingOptions {
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/notice.txt'
dependencies {
    // Default code...
    compile ''
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download