【发布时间】:2016-10-04 14:56:11
【问题描述】:
我的 build.gradle 有错误。我尝试链接到 Github 项目,但失败了。
build.gradle(项目:XXXX)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
//mavenCentral()
maven { url "https://maven/jjhesk" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
maven { url "https://maven/jjhesk" }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(模块:XXXX)
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.google.testingtimer"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
/* compile fileTree(include: ['*.jar'], dir: 'libs')
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:24.2.1'
compile 'com.github.pheynix:TimerView:660400fb64'
//androidTestCompile 'junit:junit:4.12'
}
我尝试按照本网站上的这些说明进行操作:
- https://github.com/pheynix/TimerView/blob/master/README_ENGLISH.md
- https://github.com/Todd-Davies/ProgressWheel
有人可以帮我解决这个问题吗?
【问题讨论】:
-
你得到的错误信息是什么?
-
@sanastasiadis Error(1,0) 无法为根项目获取未知属性“构建”
-
问题:你有
build.gradle(Project:XXXX)作为你根项目的build.gradle的第一行吗?你不应该。
标签: android compilation dependencies repository android-gradle-plugin