-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android studio 3.0 butterknife error #963
Comments
not suppert |
We face the same problem, |
Error:FAILURE: Build failed with an exception.
|
Use 8.x
…On Sat, May 20, 2017, 11:49 PM mtdhllf ***@***.***> wrote:
Error:FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':app:javaPreCompileDebug'.
Annotation processors must now be declared explicitly. The following
dependencies in the compile classpath are found to contain annotation
processors. Please add them to the annotationProcessor configuration.
- butterknife-7.0.1.jar
Alternatively, set
android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath
= true to continue with the previous behavior. Note that this option is
deprecated and will be removed in the future.
See
https://developer.android.com/r/tools/annotation-processor-error-message.html
for more details.
- Try:
Run with --stacktrace option to get the stack trace. Run with --debug
option to get more log output.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#963 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEd52OPeuqkWLTIBvabtMUfZGcroaks5r77RDgaJpZM4Nf9DI>
.
|
I'm using the following, with the following error: dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:8.6.0'
...
}
apply plugin: 'com.jakewharton.butterknife'
...
def butterknife = "8.6.0"
implementation "com.jakewharton:butterknife:${butterknife}" //woo new Gradle API!
annotationProcessor "com.jakewharton:butterknife-compiler:${butterknife}" Stacktrace from
It looks like I'm not really a Gradle expert - is that really the extent of the change that's necessary? |
I've also tried the 8.6.1-SNAPSHOT - same issue |
Did anyone find a workaround to this yet? |
Add Then you'll got an update for alpha2. |
I have found a workaround : But it doesn't resolve the compatibility issue with "Feature Module" : |
I understand the project can not depend on an unstable version of the gradle plugin (per comment on #964). So, as far as I see, we could:
Any other option? |
Moving the butterknife plugin locally into our projects |
@denizmveli I tried your workaround, In my case, it did not work for "Feature Module" |
How to solve the problem |
Fixed as of #1026 |
Butterknife is not working with Feature Module to support Instant Apps. gradle plugin: classpath 'com.android.tools.build:gradle:3.0.0-alpha8' project settings: implementation 'com.jakewharton:butterknife:8.7.0' Studio settings: Android Studio 3.0 Canary 8 error: element value must be a constant expression Please let me know whether butterknife is supported for instant apps and if yes what changes to be done to make it work. |
I have same problem in android studio 3.0 beta2 with butterknife 8.8.1
|
Use 9.0.0-SNAPSHOT
…On Thu, Aug 17, 2017 at 8:35 PM JokAr ***@***.***> wrote:
I have same problem in android studio 3.0 beta2 with butterknife 8.8.1
Error:A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#963 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEfTB30g37HznzWpjWg-V5mlB4PLUks5sZQaegaJpZM4Nf9DI>
.
|
it's right for use 9.0.0-SNAPSHOT
but the android studio error :
|
Yeah. But you have to add it both for buildscript { repositories { } } and
normal repositories { }.
…On Thu, Aug 17, 2017 at 10:24 PM JokAr ***@***.***> wrote:
it's right for use 9.0.0-SNAPSHOT
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
but the android studio error :
Error:Could not find com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT.
Searched in the following locations:
file:/C:/android-studio/android_studio 3.0/android-studio/gradle/m2repository/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/maven-metadata.xml
file:/C:/android-studio/android_studio 3.0/android-studio/gradle/m2repository/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/butterknife-gradle-plugin-9.0.0-SNAPSHOT.pom
file:/C:/android-studio/android_studio 3.0/android-studio/gradle/m2repository/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/butterknife-gradle-plugin-9.0.0-SNAPSHOT.jar
https://jcenter.bintray.com/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/maven-metadata.xml
https://jcenter.bintray.com/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/butterknife-gradle-plugin-9.0.0-SNAPSHOT.pom
https://jcenter.bintray.com/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/butterknife-gradle-plugin-9.0.0-SNAPSHOT.jar
Required by:
project :
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#963 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEZaDbJ6fa8-cSkb_uyNK_zQOSRVtks5sZR_6gaJpZM4Nf9DI>
.
|
this is my code |
Add it to buildscript repositories too
…On Thu, Aug 17, 2017 at 10:29 PM JokAr ***@***.***> wrote:
allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
//huaWei
maven { url 'http://developer.huawei.com/repo/' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
gradle.taskGraph.whenReady {
tasks.each { task ->
if (task.name.contains("Test")) {
task.enabled = false
}
}
}
}
this is my code
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#963 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEERQ5NtsscYTOsj5AWMyL6Do0pIqEks5sZSE3gaJpZM4Nf9DI>
.
|
Hi @JakeWharton , does order matter when listing out the repositories? I have build.gradle like following, but seems like AS does not search for sonatype repo at all. buildscript {
ext.compileSdkVersion = 26
ext.buildToolsVersion = "26.0.0"
ext.targetSdkVersion = 26
ext.minSdkVersion = 21
ext.kotlin_version = '1.1.3-2'
ext.supportVersion = "26.0.1"
ext.daggerVersion = "2.11"
ext.retrofitVersion = "2.3.0"
ext.okHttpVersion = "3.8.0"
ext.butterknifeVersion = "9.0.0-SNAPSHOT"
ext.rxjavaVersion = "2.1.0"
ext.rxAndroidVersion = "2.0.1"
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
} Do you have any idea? |
You need to add it to buildscript repositories too
…On Tue, Aug 22, 2017 at 3:33 PM Jianing Zhang ***@***.***> wrote:
Hi @JakeWharton <https://github.com/jakewharton> , does order matters
when listing out the repositories? I have build.gradle like following, but
seems like AS does not search for sonatype repo at all.
buildscript {
ext.compileSdkVersion = 26
ext.buildToolsVersion = "26.0.0"
ext.targetSdkVersion = 26
ext.minSdkVersion = 21
ext.kotlin_version = '1.1.3-2'
ext.supportVersion = "26.0.1"
ext.daggerVersion = "2.11"
ext.retrofitVersion = "2.3.0"
ext.playServicesVersion = "11.2.0"
ext.okHttpVersion = "3.8.0"
ext.butterknifeVersion = "9.0.0-SNAPSHOT"
ext.rxjavaVersion = "2.1.0"
ext.rxAndroidVersion = "2.0.1"
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}
Do you have any idea?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#963 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEUalcqMtbkXSwn2-NKeIC5GtGySHks5say0kgaJpZM4Nf9DI>
.
|
right, i saw previous comments you put up there, thought i added it there, but still no luck. Am i missing something? buildscript{
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
} |
Ah, ok. What error are you seeing?
…On Tue, Aug 22, 2017 at 3:41 PM Jianing Zhang ***@***.***> wrote:
You need to add it to buildscript repositories too
right, i saw previous comments you put up there, thought i added it there,
but still no luck. Am i missing somthing?
buildscript{
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#963 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEEEbjYptEu-_IsStzoH8uXBdpNvnb-ks5say76gaJpZM4Nf9DI>
.
|
Error:Could not find com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT.
Searched in the following locations:
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/maven-metadata.xml
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/butterknife-gradle-plugin-9.0.0-SNAPSHOT.pom
file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/butterknife-gradle-plugin-9.0.0-SNAPSHOT.jar
https://plugins.gradle.org/m2/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/maven-metadata.xml
https://plugins.gradle.org/m2/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/butterknife-gradle-plugin-9.0.0-SNAPSHOT.pom
https://plugins.gradle.org/m2/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/butterknife-gradle-plugin-9.0.0-SNAPSHOT.jar
https://jcenter.bintray.com/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/maven-metadata.xml
https://jcenter.bintray.com/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/butterknife-gradle-plugin-9.0.0-SNAPSHOT.pom
https://jcenter.bintray.com/com/jakewharton/butterknife-gradle-plugin/9.0.0-SNAPSHOT/butterknife-gradle-plugin-9.0.0-SNAPSHOT.jar
Required by:
project :playerphone Do i only need to add repo dependency in top-level build gradle file or also need to add it to module as well? |
Hello guys I am really stuck with above thing. I do not want to use 'me.tatarka:gradle-retrolambda:3.2.4' as a separate plugin |
don`t update gradle version , you can still use gradle 2.3.3 |
remove apply plugin: 'com.jakewharton.butterknife' may be worked |
Cool! ['add it to buildscript'] <- it works for me 💯 |
I remove apply plugin: 'com.jakewharton.butterknife' can works |
a workaround, tested. |
@Hemen07 I tried like you. But "'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;' |
Can't get it to build with gradle 3.0, 9.0.0-SNAPSHOT doesn't seem to work? Tried 8.8.1 aswell.
Error:
|
Just remove
Don't forget to remove
|
having these in my library's build.gradle seemed to work
thanks Jake |
This is what I tried and worked: allprojects { |
Resolved by adding dependencies Thank you. |
Documentation should be updated since AS 3.0 has been around for awhile already. Followed the documentation and nothing seemed to work. I followed every comment here and luckily got it to compile. |
Android Studio 3.0.1 is out and still not supporting Are we getting update anytime soon? |
@Aks-4125 It worked. Thanks |
compile 'com.jakewharton:butterknife:8.8.1' It worked.Thanks |
you can use gradle 2.3.3.My project can't work if I use gradle 3.0.0.But it works when I use gradle 2.3.3. |
yes i'm using Android studio 3.1 Canary 6. It can't find the butter knife jar though gradle. |
Some additional info from our post-mortem after solving this bug, in case it may contain useful info to help someone else solve it as well: Problem encountered when upgrading from Android Studio 2.3.2 to Android Studio 3.0.1: TL;DR:
Alternatively, you could instead upgrade the ButterKnife library, but for us that entailed a lot of refactor renaming, and an unknown amount of extra upgrade work, so it was not desirable at this time. Problem:
NB: We didn't make any changes to the codebase. Only the automatic changes Android Studio made to the The stacktrace for the NullPointerException we got, similar to @ZQiang94 :
Cause and explanation: The If the instantiation isn't done properly then the app crashes on startup, on line 577. ButterKnife used to instantiate these properly in Android Studio 2.3.2 (where the build would succeed). We installed Android Studio 3.0 first, and tried to build. It made some changes to
Android Studio 3.0 needs annotation processors specifically defined, for annotations to work correctly: If we try to fix it by simply adding this dependency in the We could upgrade to ButterKnife 8.2.0 or later. So the initial conclusion is that we:
Solution: Was actually able to use Android Studio 3.0 with this small change to the
|
Now this is why it's worth to regularly spend time on updating dependencies. |
@AndSync any reason why the |
I found this solution |
🤔 |
I was solving the 'spot the difference' puzzle by user @bqhub30 But I am also stuck with unable to build ButterKnife ! |
Error: I found this solution:
|
Thanks work for me, Specs build gradle:
|
follow instruction for GitHub repository which worked for me 100% with the latest version here URL: https://github.com/JakeWharton/butterknife |
No meu caso foi apenas o antivírus (KasperSky) que estava filtrando as conexões criptografadas, após desativar voltou ao normal. |
Android studio version:
Android studio 3.0 preview
gradle plugin:
expection:
I commented out the plugin(classpath 'com.jakewharton:butterknife-gradle-plugin:8.6.0'), then sync through
The text was updated successfully, but these errors were encountered: