2
按照http://developer.android.com/samples/index.html中的步驟操作,我將重複警報()項目導入Android Studio。不幸的是,我得到了一個錯誤如下:將項目導入Android Studio後出現錯誤
無法刷新Gradle項目'repeatingAlarm' 該項目使用不受支持的Android Gradle插件(0.6.3)版本。 修復插件版本並重新導入項目 快速修復失敗 無法在build.gradle文件中找到對Android Gradle插件的任何引用。 請點擊鏈接執行文本搜索,然後手動更新構建文件。
這裏下面是的build.gradle文件:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
dependencies {
// Add the support lib that is appropriate for SDK 4
compile "com.android.support:support-v4:18.0.+"
}
// The sample build uses multiple directories to
// keep boilerplate and common code separate from
// the main sample code.
List<String> dirs = [
'main', // main sample code; look here for the interesting stuff.
'common', // components that are reused by multiple samples
'template'] // boilerplate code that is generated by the sample template process
android {
compileSdkVersion 19
buildToolsVersion "18.0.1"
sourceSets {
main {
dirs.each { dir ->
java.srcDirs "src/${dir}/java"
res.srcDirs "src/${dir}/res"
}
}
instrumentTest.setRoot('tests')
instrumentTest.java.srcDirs = ['tests/src']
}
}
而且這裏的IDE告訴我,像這樣的錯誤: 那我該怎麼辦?
可能http://stackoverflow.com/questions/21562356/android-studio-0-的重複4-3-unable-to-compile-official-android-samples/21563266#21563266 – pyus13
乾杯!這確實有效! – 53iScott