首页 文章

从eclipse迁移到Android工作室“错误:(1,0)未找到id 'com.android.application'的插件”

提问于
浏览
0

我试图将我的eclipse项目导入Android studio . 但我坚持这个错误 .

“错误:(1,0)没有找到id'android'的插件”

下面是我的gradle构建 .

apply plugin:'com.android.application'

依赖项{compile fileTree(dir:'libs',include:'* .jar')compile project(':Downloads:PdfLib')}

android {compileSdkVersion 16 buildToolsVersion“22.0.1”

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')
}

}

1 回答

  • 1

    在您的应用程序gradle上尝试此操作 . 您收到此错误,因为您从未定义过您的应用程序ID ..

    android {
        compileSdkVersion 22
        buildToolsVersion "22.0.1"
    
        defaultConfig {
            applicationId "your application id or package name"
            minSdkVersion 16
            targetSdkVersion 22
        }
    }
    

    然后依赖

相关问题