【问题标题】:Error:(1, 0) Plugin with id 'android' not found. in android studio [duplicate]错误:(1, 0) 未找到 ID 为“android”的插件。在android工作室[重复]
【发布时间】:2015-06-12 09:53:26
【问题描述】:

我是 android studio 的新手,我从 eclipse mars 对我的应用程序进行分级并将其导入到 android studio,但它显示以下错误。我已经遵循了这么多答案但无法成功,谁能告诉我是什么问题,我在这里面临。提前致谢!

   apply plugin: 'com.android.application'


dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':android-support-v7-appcompat')
    compile project(':google-play-services_lib')
    compile project(':FacebookSDK')
}



android {
    compileSdkVersion 21
    buildToolsVersion "22.0.1"




    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

【问题讨论】:

  • 你的顶级 build.gradle 是什么?
  • @Selvin 我是 android studio 的新手,我没有得到你的要求

标签: android android-studio android-gradle-plugin


【解决方案1】:

用途:

apply plugin: 'com.android.application'

而不仅仅是安卓

【讨论】:

  • 还是一样的错误.....:(
猜你喜欢
  • 2014-08-03
  • 2021-12-17
  • 1970-01-01
  • 2014-08-09
  • 1970-01-01
  • 2023-04-10
  • 1970-01-01
  • 2014-09-07
相关资源
最近更新 更多