Error when running greendao module: The target server failed to respond

217 Views Asked by At

I'm working on a project which I need to implement the DB using greenDao ORM, the module of greenDao is implemented without any errors and the gradle build files for the main application and the greenDao module are as below respectively:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

and

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.example.sibco.myapplication"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.android.support:appcompat-v7:23.3.0'
}

and

apply plugin: 'java'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/freemarker-2.3.25-incubating.jar')
    compile files('libs/greendao-generator-2.1.0.jar')
}

but I get this error when I try to run greendao generator module:

Error:Gradle: A problem occurred configuring root project 'MyApplication'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:2.1.2.
     Required by:
         :MyApplication:unspecified
      > Could not resolve com.android.tools.build:gradle:2.1.2.
         > Could not get resource 'http://jcenter.bintray.com/com/android/tools/build/gradle/2.1.2/gradle-2.1.2.pom'.
            > Could not GET 'http://jcenter.bintray.com/com/android/tools/build/gradle/2.1.2/gradle-2.1.2.pom'.
               > The target server failed to respond
0

There are 0 best solutions below