这是我第一次尝试使用Android Studio。我安装了0.8.0并更新到0.8.2。只要一个项目被创建,我就会得到错误消息:

错误:(1,0)插件id 'com.android。未找到应用程序

C:\Users\Bob\ AndroidStudioProjects \ HelloAgain6 \ app \ build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.example.bob.helloagain6"
        minSdkVersion 15
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

和C:\Users\Bob\ AndroidStudioProjects \ HelloAgain6 \ build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

当前回答

其他答案对我不起作用,我猜在ButterKnife和3.0.0 alpha5之间发生了一些错误。

然而,我发现当我注释任何一个句子时,无论是BUtterKnife还是3.0.0 alpha5,它都能正常工作。

所以,你应该避免重复或冲突。

其他回答

这只是发生在我使用Android Studio 1.3.2,然而,因为我刚刚创建了项目,我删除了它,并重新创建它。 它似乎没有被Android Studio第一次正确创建,甚至没有像预期的项目文件夹。

I was using IntelliJ IDEA 13.1.5 and faced with the same problem after I changed versions of Picasso and Retrofit in dependencies in build.gradle file. I tried use many solutions, but without result. Then I cloned my project from remote git (where I pushed it before changing versions of dependencies) and it worked! After that I just closed current project and imported old project from Gradle file to IntelliJ IDEA again and it worked too! So, I think it was strange bug in intersection of IDEA, Gradle and Android plugin. I hope this information can be useful for IDEA-users or anyone else.

在我的情况下,我从GitHub下载项目,Gradle文件丢失了。所以我只是创建了一个新的项目与成功建立。然后复制粘贴Gradle缺失的文件。重建项目对我来说是可行的。

只要确保在创建应用程序时正确地设置了http和https代理

如果你在Windows上工作,你必须通过管理员启动Android Studio名称。 它解决了我的问题