2017-01-10 24 views
-1

私はこの問題を解決するために多くの方法を試しました。ERROR IDが 'com.android.application'のプラグインが見つかりません

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "anubhav.calculatorapp" 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:design:23.1.1' 
    compile files('libs/javaluator-3.0.1.jar') 
    buildscript { 
     repositories { 
      jcenter() 
     } 

     dependencies { 
      classpath 'com.android.tools.build:gradle:2.2.3' 
     } 
    } 
} 
+0

読者はむしろ助けを求めなかったでしょう。みんなのプロジェクトは彼らにとって重要であり、みんなの質問は同じ優先順位です。 – halfer

答えて

0

あなたはproject/build.gradleファイル

buildscript { 
    repositories { 
     jcenter() 
    } 

    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.3' 
    } 
} 

例プロジェクトにapp/build.gradleから(下)buildscriptラインを移動する必要がある。この問題を解決するには/ build.gradle

:ここに私のファイルbuild.gradleです
apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "anubhav.calculatorapp" 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:design:23.1.1' 
    compile files('libs/javaluator-3.0.1.jar') 
} 

例アプリ/ build.gradle

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

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

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 
関連する問題