JakeWharton / butterknife

Bind Android views and callbacks to fields and methods.
http://jakewharton.github.io/butterknife/
Apache License 2.0
25.56k stars 4.61k forks source link

butterknife gradle plugin for version 8.8.1 #1125

Closed BladeCode closed 6 years ago

BladeCode commented 6 years ago

Android Studio Release 3.0

buildscript {

repositories {
    google()
    jcenter()
}
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() maven { url "https://jitpack.io" } mavenCentral() } }

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


* module gradle config
```gradle
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'

android {
    compileSdkVersion 27
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.incoder.test"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
//            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        debug {
            minifyEnabled false
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:27.0.0'
    implementation 'com.android.support:recyclerview-v7:27.0.0'
    implementation 'com.android.support:support-v4:27.0.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'
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}

How can I solve this problem?

JakeWharton commented 6 years ago

Use 9.0.0-SNAPSHOT for now

On Sat, Oct 28, 2017, 10:16 PM Jerry xu notifications@github.com wrote:

Android Studio Release 3.0

  • Project gradle config

buildscript {

repositories {
    google()
    jcenter()
}
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() maven { url "https://jitpack.io" } mavenCentral() } }

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

  • module gradle config

apply plugin: 'com.android.application' apply plugin: 'com.jakewharton.butterknife' android { compileSdkVersion 27 buildToolsVersion "26.0.2" defaultConfig { applicationId "com.incoder.test" minSdkVersion 15 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" }

buildTypes {
    release {
        shrinkResources true
        minifyEnabled true//            minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    debug {
        minifyEnabled false
    }
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

} dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') //noinspection GradleCompatible implementation 'com.android.support:appcompat-v7:27.0.0' implementation 'com.android.support:recyclerview-v7:27.0.0' implementation 'com.android.support:support-v4:27.0.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' implementation 'com.jakewharton:butterknife:8.8.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' }

  • Exception

Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'. Possible causes for this unexpected error include:

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

How can I solve this problem?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JakeWharton/butterknife/issues/1125, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEERdOcXkLBotngzi19srpaNug8989ks5sw-ATgaJpZM4QKKX1 .

shivambhavsar commented 6 years ago

Hey i can't update project's build tool version and gradle version as it conflicts with other libraries i am using. There was a snapshot on "https://oss.sonatype.org/content/repositories/snapshots/" of version "9.0.0-20180212.024336-29" which was compatible with the gradle 3.0.1 and build tools 26.X.

That version has been removed from your artifactory. Please keep at least one snapshot compatible with gradle 3.0.1 as many of us won't be able to just update the project to latest configurations due to other libraries.

Thanks