2017-07-28 18 views
-1

どうすればこの階調エラーを解決できますか?Gradle DSLメソッドが見つかりませんでした: 'apple()'

エラー:(43、0)のGradleのDSL方式見つかりません:「りんごを()」 考えられる原因:

  • プロジェクトのDeChat」のAndroidのGradleのバージョンを使用することができるプラグインで、メソッドが含まれていません(例えば1.1.0では 'testCompile'が追加されました)。 プラグインをバージョン2.3.3にアップグレードし、プロジェクトを同期させます
  • プロジェクト 'DeChat'は、メソッドを含まないバージョンのGradleを使用している可能性があります。 Open Gradleラッパーファイル
  • ビルドファイルにGradleプラグインがない可能性があります。 はGradleのプラグインを適用
  • ビルド:Gradleの

    apply plugin: 'com.android.application' 
    
    android { 
        compileSdkVersion 25 
        buildToolsVersion "26.0.0" 
        defaultConfig { 
         applicationId "com.suvysoft.dechat" 
         minSdkVersion 19 
         targetSdkVersion 25 
         versionCode 1 
         versionName "1.0" 
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
        } 
        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:25.3.1' 
        compile 'com.android.support.design:25.1.1' 
        compile 'com.android.support.constraint:constraint-layout:1.0.2' 
        //firebase 
        compile 'com.google.firebase:firebase-database:9.6.1' 
        compile 'com.google.firebase:firebase-messaging:9.6.1' 
        compile 'com.google.firebase:firebase-auth:9.6.1' 
    
        //okhttp 
    
        compile 'com.squareup.okhttp3:okhttp:3.4.1' 
    
        //event bus 
    
        compile 'org.greenrobot:eventbus:3.0.0' 
    } 
    apple plugin: 'com.google.gms.google-services' 
    

    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.3.3' 
         classpath 'com.google.gms:google-services:3.0.0' 
    
         // 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 
    } 
    
    +0

    ... ** apple ** ?!どこかに行って!!あなたはもはや私の友人ではありません! ;) –

    答えて

    1

    これはあなたのエラーです:

    apple plugin: 'com.google.gms.google-services' 
    

    それがなければならない。

    apply plugin: 'com.google.gms.google-services' 
    

    タイプミス以外は何もありません。

    関連する問題