Error building Android project with Guava reference Edited

I'm trying to configure Bitbucket Pipelines on my Android project but I still haven't been able to make it work.

I'm receiving this error message: 

 

A problem occurred configuring root project 'build'.
> Could not resolve all files for configuration ':classpath'.
   > Could not download guava.jar (com.google.guava:guava:18.0)
      > Could not get resource 'https://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.jar'.
         > Response 304: Not Modified has no content!

I'm not sure why is it trying to use Guava 18.0 if my build.gradle uses version 20.0.

Root build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.0.0'

        /*classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'*/
        classpath 'me.tatarka:gradle-retrolambda:3.3.1'
        classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
    }
}
allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}
dependencies {
}

ext {
    // Sdk and tools
    minSdkVersion = 15
    targetSdkVersion = 25
    compileSdkVersion = 25
    buildToolsVersion = '25.0.2'

    // App dependencies
    supportLibraryVersion = '25.3.1'
    guavaVersion = '20.0'
    googlePlayServices = '10.2.1'
}

Module build.gradle:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'me.tatarka.retrolambda'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    dexOptions {
        maxProcessCount 2
        javaMaxHeapSize "2g"
    }
    defaultConfig {
        applicationId "br.com.myapp.app"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dataBinding {
        enabled = true
    }

    packagingOptions {
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    /*androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })*/

    // Support libraries
    compile "com.android.support:design:$rootProject.ext.supportLibraryVersion"
    compile "com.android.support:cardview-v7:$rootProject.ext.supportLibraryVersion"
    compile "com.android.support:recyclerview-v7:$rootProject.ext.supportLibraryVersion"
    compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
    compile "com.android.support:support-v4:$rootProject.ext.supportLibraryVersion"
    compile "com.android.support:gridlayout-v7:$rootProject.ext.supportLibraryVersion"
    compile "com.android.support:customtabs:$rootProject.ext.supportLibraryVersion"

    // Google Maps
    //compile 'com.google.android.gms:play-services:10.0.0'
    compile "com.google.android.gms:play-services-maps:$rootProject.ext.googlePlayServices"
    compile "com.google.android.gms:play-services-location:$rootProject.ext.googlePlayServices"
    compile "com.google.android.gms:play-services-places:$rootProject.ext.googlePlayServices"
    compile 'com.android.support:multidex:1.0.0'

    // Firebase
//    compile 'com.google.firebase:firebase-database:10.0.0'

    // jUnit
    /*testCompile 'junit:junit:4.12'*/

    // Crashlytics
    compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
        transitive = true;
    }

    // Parceler
    /*compile 'org.parceler:parceler-api:1.1.1'
    apt 'org.parceler:parceler:1.1.1'*/

    // Retrofit
    compile 'com.google.code.gson:gson:2.7'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.squareup:android-times-square:1.6.5@aar'
    compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'

    // Glide
    compile 'com.github.bumptech.glide:glide:3.7.0'

    // Glide Transformations
    compile 'jp.wasabeef:glide-transformations:2.0.1'

    // ReactiveX
    /*compile 'io.reactivex:rxandroid:1.2.0'
    compile 'io.reactivex:rxjava:1.1.4'*/

    // SparkButton
    compile 'com.github.varunest:sparkbutton:1.0.2'

    // DI
    /*apt 'com.google.dagger:dagger-compiler:2.7'
    compile 'com.google.dagger:dagger:2.7'
    provided 'javax.annotation:jsr250-api:1.0'*/

    // MaterialDatePicker
    /*compile 'com.wdullaer:materialdatetimepicker:3.0.0'*/

    // Date
    /*compile 'joda-time:joda-time:2.9.6'*/

    //CircleImageView
    compile 'de.hdodenhof:circleimageview:2.1.0'

    //HelpStack
    compile 'com.tenmiles:helpstack:1.2.0'

    // Guava
    compile "com.google.guava:guava:$rootProject.ext.guavaVersion"

   // compile 'com.microsoft.azure:azure-mobile-android:3.1.0'
    /*compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@jar'*/


    compile 'com.jaredrummler:material-spinner:1.1.0'
}


apply plugin: 'com.google.gms.google-services'

And here is my bitbucket-pipelines.yml:

image: uber/android-build-environment:latest
pipelines:
  default:
    - step:
        script:
          - echo y | android update sdk --filter "extra-android-m2repository" --no-ui -a # Grab the Android Support Repo which isn't included in the container
          - bash ./gradlew build

 

What is wrong with it?

1 answer

This widget could not be displayed.

Hi Juliano! For this kind of question, my recommendation would be to post it at community.developer.atlassian.com so our developer community can help you out :)

Cheers,

Ana

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,328 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you