Android Studio错误:(3,0)未找到id为'com.android.application'的插件 [英] Android Studio Error:(3, 0) Plugin with id 'com.android.application' not found

查看:179
本文介绍了Android Studio错误:(3,0)未找到id为'com.android.application'的插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚接触android studio,并且有人写了一个我最初用于应用程序发明者的应用程序。我遵循他的模板并添加了新的东西。

I'm new to android studio and had somebody write an app I made which was originally used in app inventor. I followed his template and added new things. The app has a problem with the Gradle and gives me the following.

"Error:(3, 0) Plugin with id 'com.android.application' not found."

它还表示我的附加Android支持库并未安装,但它是。并且一切都是最新的。我看到很多关于更新Gradle的事情,如果SDK管理器没有,我该怎么做。

It also says that my extras Android Support Repository isn't installed however it is. and everything is up to date. I saw many things about updating the Gradle, How do I do that if the SDK manager didn't.

代码是:

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

apply plugin: 'com.android.application'
android {
    compileSdkVersion 21
    buildToolsVersion "21.0.2"

    defaultConfig {
        applicationId "contactorganizer.introcode.or.myapplication"
        minSdkVersion 8
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.0'
}

抱歉没有太多知识。
如果你想要这个项目,我可以通过电子邮件发送给你,因为我完全没有线索,并且很想构建这个项目。
感谢您的帮助!

Sorry about not having much knowledge. If you would like the project I can email it to you because I have absolutely no clue and would love to just build this. Thanks for your help!

推荐答案

当我将Android Studio更新到最新版本时,我遇到了同样的问题。

When I updated my Android Studio to the latest, I got the same problem. Here is how I solved it.

第一步:
将以下代码添加到build.gradle的顶部:

First: Add the following code to the top of your build.gradle:

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

allprojects {
    repositories {
        jcenter()
    }
}

第二:查找gradle-wrapper.properties。
将最后一句更改为:

Second: Find the gradle-wrapper.properties. Change the last sentence to this:

distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip

希望这适合您。

这篇关于Android Studio错误:(3,0)未找到id为'com.android.application'的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆