2017-11-15 6 views
0

私はアンドロイドのスタジオでbutterknifeプラグインを使用しようとしていますが、私は次のエラー得続ける:butterknifeためのgithubの上の私が続くと行っているアンドロイドbutterknifeに動作していないとAndroidスタジオ3.0

Error: Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'.

すべてのステップを。

アプリ

apply plugin: 'com.android.application' 
apply plugin: 'com.jakewharton.butterknife' 

android { 
    compileSdkVersion 26 
    defaultConfig { 
     applicationId "com.example.ilove.butterknifedemo" 
     minSdkVersion 16 
     targetSdkVersion 26 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    implementation fileTree(dir: 'libs', include: ['*.jar']) 
    implementation 'com.android.support:appcompat-v7:26.1.0' 
    implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
    testImplementation 'junit:junit:4.12' 
    androidTestImplementation 'com.android.support.test:runner:1.0.1' 
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 
    compile 'com.squareup:otto:1.3.8' 
    compile 'com.jakewharton:butterknife:8.8.1' 
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' 
} 

プロジェクト

buildscript { 

    repositories { 
     google() 
     jcenter() 
     mavenCentral() 

    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:3.0.0' 
     classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1' 


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

allprojects { 
    repositories { 
     google() 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 
+0

ButterKnife Gradleプラグインを削除するだけで問題ありませんが、必要に応じて適切なプロガードルールを追加することを忘れないでくださいProtoard – EpicPandaForce

+0

Butterknifeをライブラリに依存せずにプロジェクトに追加したいだけなら、EpicPandaForceはバターナイフのプラグインとbuilgegradleプロジェクトのクラスパス依存関係を削除するだけです。 モジュールのbuild.gradleファイルに、コンパイルと注釈プロセッサの依存関係を確実に追加してください。 – Yajairo87

答えて

0

変更のGradleのバージョン:3.0.0 2.3.3をするには、以下の私は、プロジェクトレベルおよびアプリケーションレベルのGradleファイルの両方を持っているコードです。

dependencies { 
    classpath 'com.android.tools.build:gradle:2.3.3' 
    classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1' 


    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
} 
関連する問題