2016-06-11 7 views
0

私はAndroidスタジオで友達のプロジェクトを開きます。私のASバージョンは彼よりも大きいです。ここで

は誤りである:ここではGradle DSLメソッドが見つかりませんでした。アンドロイド()

Error:(27, 0) Gradle DSL method not found: 'android()' 
Possible causes:The project 'firstapp' may be using a version of Gradle that does not contain the method. 
Open Gradle wrapper file  The build file may be missing a Gradle plugin. 
Apply Gradle plugin. 

は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.0-alpha1' 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 
allprojects { 
    repositories { 
     jcenter() 
     mavenCentral() 
     maven { 
      url 'https://oss.sonatype.org/content/repositories/snapshots/' 
     } 
    } 
} 
task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

android { 
    compileSdkVersion 19 
    buildToolsVersion '21.0.0' 
} 
dependencies { 
} 

答えて

2

ここを公式の文書から見てください。 https://developer.android.com/studio/build/index.html

/** 
 * The first line in the build configuration applies the Android plugin for 
 * Gradle to this build and makes the android {} block available to specify 
 * Android-specific build options. 
 */ 

apply plugin: 'com.android.application' 
+0

今、私は別のエラーを取得:エラー:(2、0)原因:COM /アンドロイド/構築/ Gradleの/ AppPlugin:サポートされていないメジャー。マイナーバージョン52.0 Open File

+0

使用するJava 7の代わりに、8つの – mrkernelpanic

+0

感謝を、プロジェクトはjdk 1.7を使用していました。私は1.8 –

関連する問題