1
我的build.gradle出現錯誤。我嘗試鏈接到Github項目,但失敗了。Gradle項目同步完成時出現一些錯誤(無法同步)
的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
@sanastasiadis錯誤(1,0)無法獲取根項目的未知屬性'build' – Jane
問題:你有'build.gradle(Project:XXXX)'作爲你的根項目的build.gradle的第一行嗎?你不應該。 – sanastasiadis