【问题标题】:Migrating from eclipse to Android studio "Error:(1, 0) Plugin with id 'com.android.application' not found"从 Eclipse 迁移到 Android Studio “错误:(1, 0) 未找到 ID 为 'com.android.application' 的插件”
【发布时间】:2015-10-14 21:32:08
【问题描述】:

我尝试将我的 Eclipse 项目导入 Android Studio。但我陷入了这个错误。

“错误:(1, 0) 未找到 ID 为 'android' 的插件”

以下是我的 gradle 构建。

应用插件:'com.android.application'

依赖{ 编译文件树(目录:'libs',包括:'*.jar') 编译项目(':下载:PdfLib') }

机器人{ 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')
}

}

【问题讨论】:

  • 在您的应用程序 gradle defaultConfig { applicationId "your package name or application id" minSdkVersion 16 targetSdkVersion 22 } 上试试这个

标签: android eclipse


【解决方案1】:

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

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "your application id or package name"
        minSdkVersion 16
        targetSdkVersion 22
    }
}

然后依赖

【讨论】:

  • 然后接受我的回答..所以它对其他有同样问题的人很有用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-09-07
  • 1970-01-01
  • 2019-01-02
  • 2023-03-19
  • 2020-02-17
相关资源
最近更新 更多