2015-01-09 108 views
3

我遷移我的項目從日食到Android工作室,我收到此錯誤:從Eclipse的遷移...錯誤:(1,0)插件ID爲「com.android.application」未找到

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

我有gradle這個2.2.1和Android工作室的最後一個版本,1.0.2

我的文件:

模塊APP:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 19 
    buildToolsVersion "21.1.2" 

    defaultConfig { 
     applicationId "com.myapp" 
     minSdkVersion 14 
     targetSdkVersion 19 
    } 

    buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' 
     } 
    } 

    dependencies { 
     classpath 'com.android.tools.build:gradle:1.0.0' 
     compile 'com.google.android.gms:play-services-ads:6.5.87' 
    } 
} 

項目:

// Top-level build file where you can add configuration options common to all sub-projects/modules. 
buildscript { 
    repositories { 
     jcenter() 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

gradle這個包裝特性:

#Wed Apr 10 15:27:10 PDT 2013 
distributionBase=GRADLE_USER_HOME 
distributionPath=wrapper/dists 
zipStoreBase=GRADLE_USER_HOME 
zipStorePath=wrapper/dists 
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip 
+0

奇怪。你能發佈你的'gradle/wrapper/gradle-wrapper.properties'文件嗎? – shkschneider

+0

發佈了.......... – NullPointerException

+3

在'buildscript'裏面移動classpath''com.android.tools.build:gradle:1.0.0'' – Tarun

回答

0

的工作gradle這個build文件。

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:0.14.2' 
    } 
} 
apply plugin: 'com.android.application' 

repositories { 
    jcenter() 
} 

android { 
    compileSdkVersion 21 
    buildToolsVersion "21.1.2" 

    defaultConfig { 
     minSdkVersion 9 
     targetSdkVersion 21 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 
dependencies { 
    compile 'com.google.android.gms:play-services:6.5.87' 

} 
+1

不適合我...... – NullPointerException

+0

仍然是同樣的問題? – Tarun

+0

如果您已經嘗試了我發佈的構建文件,請檢查compileSdkVersion。 – Tarun

相關問題