我正在做一个项目,我需要使用greenDao ORM实现数据库,greenDao的模块实现没有任何错误,主应用程序和greenDao模块的gradle构建文件分别如下:
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
}
和
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'
}
和
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')
}
但是当我尝试运行 greendao 生成器模块时出现此错误:
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