2015-11-30 80 views
0

我一直在尋找其他類似的問題,並改變了他們所說的一切.. 但是,由於我已將我的Android Studio更新到2.0,因此錯誤仍然存​​在 If任何人都可以幫忙!未找到Gradle DSL方法:Android Studio 2.0上的'compile()'

在搖籃scrips我有兩個文件的gradle -

的build.gradle(項目:我的項目)

的build.gradle(模塊:APP)

的build.gradle(項目:我項目) - 這個文件看起來像這樣

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

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     compile fileTree(dir: 'libs', include: ['*.jar']) 
     classpath 'com.android.tools.build:gradle:2.0.0-alpha1' 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

和其他的build.gradle(模塊:APP) - 這個文件看起來像這樣

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

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

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:23.1.1' 
} 
+0

唐氏投票贏得」如果你知道如何解決這個問題,請幫助我解決問題。請幫助 – shadygoneinsane

回答

2

在第一文件中刪除此行:

編譯文件樹(DIR: '庫',包括:[ '的* .jar'])

buildscript { 
repositories { 
    jcenter() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:2.0.0-alpha1' 
    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
} 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 
相關問題