N Sharma
N Sharma

Reputation: 34497

Failed to resolve: org.roboelectric:roboelectric:3.2.2

I am learning unit testing for my android apps. I am using roboelectric framework to achieve this.

build.gradle

apply plugin: 'com.android.application'
apply plugin: 'realm-android'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.xyz.helloworld"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dataBinding {
        enabled = true
    }
}

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'
    })
    compile 'com.android.support:appcompat-v7:25.1.1'
    testCompile 'junit:junit:4.12'
    testCompile 'org.robolectric:robolectric:3.2.2'
}

I am getting an error Failed to resolve: org.roboelectric:roboelectric:3.2.2 & synced with Gradle multiple times.

enter image description here How can I resolve this issue? Thanks in advance

Upvotes: 2

Views: 953

Answers (1)

N Sharma
N Sharma

Reputation: 34497

It was some proxy kinda issue. I switched to different network then it worked for me. Thanks

Upvotes: 1

Related Questions