首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在将一个项目导入Android之后,我得到了一个错误

在将一个项目导入Android之后,我得到了一个错误
EN

Stack Overflow用户
提问于 2014-02-05 16:46:12
回答 1查看 4.5K关注 0票数 2

按照http://developer.android.com/samples/index.html中的步骤,我将repeatingAlarm (http://developer.android.com/samples/repeatingAlarm/project.html)项目导入到Android中。不幸的是,下面出现了一个错误:

未能刷新Gradle项目'repeatingAlarm‘该项目使用的是一个不受支持的Android插件版本(0.6.3)。修复插件版本和重新导入项目Quick失败,无法在build.gradle文件中找到对Android插件的任何引用。请单击该链接执行文本搜索,然后手动更新生成文件。

下面是build.gradle文件:

代码语言:javascript
复制
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告诉我这样一个错误:

我该怎么做?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-09-23 08:52:30

将buildToolsVersion "18.0.1“更改为最新版本,如"20.0.1",它将工作:)

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21583277

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档