Skip to content
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

Java.lang.NoSuchMethodError: com.squareup.javapoet.TypeName.isBoxedPrimitive()Z #64

Closed
vdubedout opened this issue May 26, 2016 · 15 comments

Comments

@vdubedout
Copy link

vdubedout commented May 26, 2016

Hi,

I tried to update to the latest 0.2.2 and I have this error while compiling.

[...]GeevApp.java
Error:(12, 59) error: cannot find symbol class DaggerApplicationComponent
[...]GeevServiceModule.java
Error:(5, 38) error: package com.ryanharter.auto.value.gson does not exist
Warning:@AutoValue classes cannot have abstract methods other than property getters and Builder converters
:app:compileRetrolambdaDebug
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.NoSuchMethodError: com.squareup.javapoet.TypeName.isBoxedPrimitive()Z

I use those AutoValue versions:

// Autovalue 
    apt 'com.google.auto.value:auto-value:1.2'
    provided 'com.jakewharton.auto.value:auto-value-annotations:1.2-update1'
    apt 'com.ryanharter.auto.value:auto-value-parcel:0.2.2'
    apt 'com.ryanharter.auto.value:auto-value-gson:0.3.1'

Everything ok on 0.2.1

@JakeWharton
Copy link
Collaborator

Your version of JavaPoet is being resolved incorrectly on the apt classpath for reasons that I still can't figure out.

Adding

apt 'com.squareup:javapoet:1.7.0'

first will fix this

@gabrielittner
Copy link
Contributor

Whenever I've seen someone report it, it was because Dagger 2.2 bundles
JavaPoet 1.6 in it's jar and doesn't shade it.

On Thu, 26 May 2016, 22:40 Jake Wharton, notifications@github.com wrote:

Your version of JavaPoet is being resolved incorrectly on the apt
classpath for reasons that I still can't figure out.

Adding

apt 'com.squareup:javapoet:1.7.0'

first will fix this


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#64 (comment)

@JakeWharton
Copy link
Collaborator

Let's all agree to stop using Dagger 2.2! Dagger 2.4 people!

On Thu, May 26, 2016 at 4:49 PM Gabriel Ittner notifications@github.com
wrote:

Whenever I've seen someone report it, it was because Dagger 2.2 bundles
JavaPoet 1.6 in it's jar and doesn't shade it.

On Thu, 26 May 2016, 22:40 Jake Wharton, notifications@github.com wrote:

Your version of JavaPoet is being resolved incorrectly on the apt
classpath for reasons that I still can't figure out.

Adding

apt 'com.squareup:javapoet:1.7.0'

first will fix this


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
<
#64 (comment)


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#64 (comment)

@vanniktech
Copy link
Contributor

vanniktech commented May 26, 2016

Even apt 'com.squareup:javapoet:1.7.0' won't fix it for me. Also I'm using Dagger 2.4.

apt
+--- com.google.dagger:dagger-compiler:2.4
|    +--- com.google.dagger:dagger:2.4
|    |    \--- javax.inject:javax.inject:1
|    +--- com.google.dagger:dagger-producers:2.4
|    |    +--- com.google.dagger:dagger:2.4 (*)
|    |    \--- com.google.guava:guava:19.0
|    \--- com.google.guava:guava:19.0
+--- com.squareup:javapoet:1.7.0
+--- com.vanniktech:onactivityresult-compiler:0.4.0
|    +--- com.vanniktech:onactivityresult-annotations:0.4.0
|    +--- com.google.auto.service:auto-service:1.0-rc2
|    |    +--- com.google.auto:auto-common:0.3 -> 0.6
|    |    |    \--- com.google.guava:guava:18.0 -> 19.0
|    |    \--- com.google.guava:guava:18.0 -> 19.0
|    \--- com.squareup:javapoet:1.5.1 -> 1.7.0
+--- com.google.auto.value:auto-value:1.2
+--- com.ryanharter.auto.value:auto-value-parcel:0.2.2
|    +--- com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.2
|    +--- com.google.auto.value:auto-value:1.2
|    +--- com.google.auto:auto-common:0.6 (*)
|    +--- com.google.auto.service:auto-service:1.0-rc2 (*)
|    +--- org.apache.commons:commons-lang3:3.4
|    \--- com.squareup:javapoet:1.7.0
+--- com.google.android.gms:play-services-gcm:9.0.0
|    +--- com.google.android.gms:play-services-base:9.0.0
|    |    +--- com.google.android.gms:play-services-basement:9.0.0
|    |    |    \--- com.android.support:support-v4:23.0.0
+--- com.ryanharter.auto.value:auto-value-moshi:0.3.2
|    +--- com.google.auto.value:auto-value:1.2
|    +--- com.google.auto:auto-common:0.6 (*)
|    +--- com.squareup.moshi:moshi:1.0.0 -> 1.1.0
|    |    \--- com.squareup.okio:okio:1.6.0
|    +--- com.google.auto.service:auto-service:1.0-rc2 (*)
|    \--- com.squareup:javapoet:1.7.0
+--- com.jakewharton:butterknife-compiler:8.0.1
|    +--- io.reactivex:rxjava:1.1.3 -> 1.1.5
|    +--- com.google.auto:auto-common:0.6 (*)
|    +--- com.google.auto.service:auto-service:1.0-rc2 (*)
|    +--- com.jakewharton:butterknife-annotations:8.0.1
|    |    \--- com.android.support:support-annotations:23.3.0 -> 23.4.0
|    \--- com.squareup:javapoet:1.6.1 -> 1.7.0
+--- io.requery:requery-processor:1.0.0-beta18
|    +--- org.eclipse.persistence:javax.persistence:2.1.1
|    +--- io.requery:requery:1.0.0-beta18
|    \--- com.squareup:javapoet:1.7.0

EDIT:

apt with auto-value-parcel 0.2.1

+--- com.ryanharter.auto.value:auto-value-parcel:0.2.1
|    +--- com.squareup:javapoet:1.4.0 -> 1.7.0
|    +--- com.google.auto:auto-common:0.6 (*)
|    +--- com.google.auto.service:auto-service:1.0-rc2 (*)
|    +--- org.apache.commons:commons-lang3:3.4
|    +--- com.google.auto.value:auto-value:1.2-rc1 -> 1.2
|    \--- com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.1

apt with auto-value-parcel 0.2.2

+--- com.ryanharter.auto.value:auto-value-parcel:0.2.2
|    +--- com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.2
|    +--- com.google.auto.value:auto-value:1.2
|    +--- com.google.auto:auto-common:0.6 (*)
|    +--- com.google.auto.service:auto-service:1.0-rc2 (*)
|    +--- org.apache.commons:commons-lang3:3.4
|    \--- com.squareup:javapoet:1.7.0

@vdubedout
Copy link
Author

vdubedout commented May 26, 2016

I'm using Dagger 2.4,

Adding javapoet:1.7.0 solved the problem. Commenting it back, problem back.

Thanks :)

@vdubedout
Copy link
Author

If that can help

apt
+--- com.google.auto.value:auto-value:1.2
+--- com.squareup:javapoet:1.7.0
+--- com.ryanharter.auto.value:auto-value-parcel:0.2.2
|    +--- com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.2
|    +--- com.google.auto.value:auto-value:1.2
|    +--- com.google.auto:auto-common:0.6
|    |    \--- com.google.guava:guava:18.0 -> 19.0
|    +--- com.google.auto.service:auto-service:1.0-rc2
|    |    +--- com.google.auto:auto-common:0.3 -> 0.6 (*)
|    |    \--- com.google.guava:guava:18.0 -> 19.0
|    +--- org.apache.commons:commons-lang3:3.4
|    \--- com.squareup:javapoet:1.7.0
+--- com.ryanharter.auto.value:auto-value-gson:0.3.1
|    +--- com.google.auto.value:auto-value:1.2
|    +--- com.google.auto:auto-common:0.6 (*)
|    +--- com.google.auto.service:auto-service:1.0-rc2 (*)
|    +--- com.squareup:javapoet:1.7.0
|    \--- com.google.code.gson:gson:2.6.2
+--- com.jakewharton:butterknife-compiler:8.0.1
|    +--- io.reactivex:rxjava:1.1.3 -> 1.1.5
|    +--- com.google.auto:auto-common:0.6 (*)
|    +--- com.google.auto.service:auto-service:1.0-rc2 (*)
|    +--- com.jakewharton:butterknife-annotations:8.0.1
|    |    \--- com.android.support:support-annotations:23.3.0 -> 23.4.0
|    \--- com.squareup:javapoet:1.6.1 -> 1.7.0
+--- com.google.dagger:dagger-compiler:2.4
|    +--- com.google.dagger:dagger:2.4
|    |    \--- javax.inject:javax.inject:1
|    +--- com.google.dagger:dagger-producers:2.4
|    |    +--- com.google.dagger:dagger:2.4 (*)
|    |    \--- com.google.guava:guava:19.0
|    \--- com.google.guava:guava:19.0
+--- com.github.hotchemi:permissionsdispatcher-processor:2.1.2
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.0.0
|    |    \--- org.jetbrains.kotlin:kotlin-runtime:1.0.0
|    \--- com.squareup:javapoet:1.6.0 -> 1.7.0
+--- com.jakewharton.hugo:hugo-annotations:1.2.1
+--- com.android.support:design:23.4.0
|    +--- com.android.support:recyclerview-v7:23.4.0
|    |    +--- com.android.support:support-annotations:23.4.0
|    |    \--- com.android.support:support-v4:23.4.0
|    |         \--- com.android.support:support-annotations:23.4.0
|    +--- com.android.support:appcompat-v7:23.4.0
|    |    +--- com.android.support:animated-vector-drawable:23.4.0
|    |    |    \--- com.android.support:support-vector-drawable:23.4.0
|    |    |         \--- com.android.support:support-v4:23.4.0 (*)
|    |    +--- com.android.support:support-v4:23.4.0 (*)
|    |    \--- com.android.support:support-vector-drawable:23.4.0 (*)
|    \--- com.android.support:support-v4:23.4.0 (*)
+--- com.android.support:appcompat-v7:23.4.0 (*)
+--- com.github.JakeWharton:ViewPagerIndicator:2.4.1
|    \--- com.android.support:support-v4:23.1.+ -> 23.4.0 (*)
+--- com.github.chyrta:AndroidOnboarder:0.6
+--- com.google.android.gms:play-services-maps:8.4.0
|    \--- com.google.android.gms:play-services-base:8.4.0
|         \--- com.google.android.gms:play-services-basement:8.4.0
|              \--- com.android.support:support-v4:23.0.0 -> 23.4.0 (*)
+--- com.squareup.picasso:picasso:2.5.2
+--- com.github.andrewlord1990:snackbarbuilder:0.5.0
|    +--- com.android.support:appcompat-v7:23.1.1 -> 23.4.0 (*)
|    \--- com.android.support:design:23.1.1 -> 23.4.0 (*)
+--- com.squareup.retrofit2:retrofit:2.0.2
|    \--- com.squareup.okhttp3:okhttp:3.2.0
|         \--- com.squareup.okio:okio:1.6.0
+--- com.squareup.retrofit2:retrofit-converters:2.0.2
+--- com.squareup.retrofit2:converter-gson:2.0.2
|    +--- com.squareup.retrofit2:retrofit:2.0.2 (*)
|    \--- com.google.code.gson:gson:2.6.1 -> 2.6.2
+--- com.squareup.okhttp3:okhttp:3.2.0 (*)
+--- com.google.code.gson:gson:2.6.2
+--- com.jakewharton:butterknife:8.0.1
|    +--- com.jakewharton:butterknife-annotations:8.0.1 (*)
|    \--- com.android.support:support-annotations:23.3.0 -> 23.4.0
+--- com.google.dagger:dagger:2.4 (*)
+--- com.j256.ormlite:ormlite-core:4.48
+--- com.j256.ormlite:ormlite-android:4.48
|    \--- com.j256.ormlite:ormlite-core:4.48
+--- com.jakewharton.threetenabp:threetenabp:1.0.3
|    \--- org.threeten:threetenbp:1.3.1
+--- io.reactivex:rxjava:1.1.5
+--- com.facebook.android:facebook-android-sdk:4.11.0
|    +--- com.parse.bolts:bolts-android:1.4.0
|    |    +--- com.parse.bolts:bolts-tasks:1.4.0
|    |    \--- com.parse.bolts:bolts-applinks:1.4.0
|    |         \--- com.parse.bolts:bolts-tasks:1.4.0
|    +--- com.android.support:support-v4:23.2.1 -> 23.4.0 (*)
|    +--- com.android.support:cardview-v7:23.2.1
|    \--- com.android.support:customtabs:23.2.1
|         +--- com.android.support:support-v4:23.2.1 -> 23.4.0 (*)
|         \--- com.android.support:support-annotations:23.2.1 -> 23.4.0
+--- com.github.hotchemi:permissionsdispatcher:2.1.2
|    \--- com.android.support:support-v4:23.1.1 -> 23.4.0 (*)
+--- com.google.android.gms:play-services-location:8.4.0
|    +--- com.google.android.gms:play-services-base:8.4.0 (*)
|    \--- com.google.android.gms:play-services-maps:8.4.0 (*)
+--- io.nlopez.smartlocation:library:3.2.2
|    +--- com.android.support:support-annotations:23.1.1 -> 23.4.0
|    \--- com.google.android.gms:play-services-location:8.4.0 (*)
+--- com.github.orhanobut:logger:1.12
+--- com.google.android.gms:play-services-appindexing:8.4.0
|    \--- com.google.android.gms:play-services-base:8.4.0 (*)
+--- com.jakewharton.auto.value:auto-value-annotations:1.2-update1
\--- org.glassfish:javax.annotation:10.0-b28

@bricestacey
Copy link

I ran into the same issue. You can downgrade to dagger 2.0.2 unless you need the bleeding edge.

@rharter
Copy link
Owner

rharter commented Jun 8, 2016

So the solution here is to upgrade to Dagger 2.4. I'm going to close this as there is nothing for us to do.

@vdubedout
Copy link
Author

vdubedout commented Jun 13, 2016

The solution is to add :
apt 'com.squareup:javapoet:1.7.0'

I was already using dagger 2.4 on my code when the bug came out.

@aegis123
Copy link

aegis123 commented Jun 14, 2016

Nevermind issue seem be because of com.ryanharter.auto.value:auto-value-parcel:0.2.2 when going back to 0.2.1 every worked again.

I keep getting this error: java.lang.NoSuchMethodError: com.squareup.javapoet.TypeName.isBoxedPrimitive()Z I updated to autovalue 1.3-rc1 and updated the parceler and gson extension also then I got this error which didn't go away even when adding apt 'com.squareup:javapoet:1.7.0' to the dependencies. Now i'm switching back to 1.2 and the latest non RC parceler and gson extensions and I still keep getting this error. I already did a gradle clean and Android Studio invalidate cache and nothing seems to work. In External Libraries in AS I see the correct javapoet version 1.7.0 and when I go to the com.ryanharter.auto.value.parcel.Parcelables.java there I can click throught to com.squareup.javapoet.TypeName.isBoxedPrimitive() with cmd/ctrl click in the code? Anyone know what I'm doing wrong? btw I'm using Dagger 2.4

apt
+--- com.google.dagger:dagger-compiler:2.4
|    +--- com.google.dagger:dagger:2.4
|    |    \--- javax.inject:javax.inject:1
|    +--- com.google.dagger:dagger-producers:2.4
|    |    +--- com.google.dagger:dagger:2.4 (*)
|    |    \--- com.google.guava:guava:19.0
|    \--- com.google.guava:guava:19.0
+--- com.google.auto.value:auto-value:1.2
+--- com.ryanharter.auto.value:auto-value-parcel:0.2.2
|    +--- com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.2
|    +--- com.google.auto.value:auto-value:1.2
|    +--- com.google.auto:auto-common:0.6
|    |    \--- com.google.guava:guava:18.0 -> 19.0
|    +--- com.google.auto.service:auto-service:1.0-rc2
|    |    +--- com.google.auto:auto-common:0.3 -> 0.6 (*)
|    |    \--- com.google.guava:guava:18.0 -> 19.0
|    +--- org.apache.commons:commons-lang3:3.4
|    \--- com.squareup:javapoet:1.7.0
+--- com.ryanharter.auto.value:auto-value-gson:0.3.1
|    +--- com.google.auto.value:auto-value:1.2
|    +--- com.google.auto:auto-common:0.6 (*)
|    +--- com.google.auto.service:auto-service:1.0-rc2 (*)
|    +--- com.squareup:javapoet:1.7.0
|    \--- com.google.code.gson:gson:2.6.2
+--- com.squareup.auto.value:auto-value-redacted:1.0.0
|    +--- com.google.auto.value:auto-value:1.2
|    \--- com.squareup:javapoet:1.7.0
+--- com.jakewharton:butterknife-compiler:8.0.1
|    +--- io.reactivex:rxjava:1.1.3 -> 1.1.5
|    +--- com.google.auto:auto-common:0.6 (*)
|    +--- com.google.auto.service:auto-service:1.0-rc2 (*)
|    +--- com.jakewharton:butterknife-annotations:8.0.1
|    |    \--- com.android.support:support-annotations:23.3.0 -> 23.4.0
|    \--- com.squareup:javapoet:1.6.1 -> 1.7.0
+--- com.google.dagger:dagger:2.4 (*)
+--- com.google.guava:guava:19.0
+--- com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.2
+--- com.crashlytics.sdk.android:crashlytics:2.5.5
|    +--- com.crashlytics.sdk.android:answers:1.3.6
|    |    \--- io.fabric.sdk.android:fabric:1.3.10
|    +--- com.crashlytics.sdk.android:crashlytics-core:2.3.8
|    |    +--- com.crashlytics.sdk.android:answers:1.3.6 (*)
|    |    \--- io.fabric.sdk.android:fabric:1.3.10
|    +--- io.fabric.sdk.android:fabric:1.3.10
|    \--- com.crashlytics.sdk.android:beta:1.1.4
+--- org.piwik.sdk:piwik-sdk:1.0.1
|    +--- com.android.support:support-annotations:23.4.0
|    \--- com.jakewharton.timber:timber:4.1.2
+--- io.requery:sqlite-android:3.13.0-2
|    \--- com.android.support:support-v4:23.1.1 -> 23.4.0
|         \--- com.android.support:support-annotations:23.4.0
+--- net.zetetic:android-database-sqlcipher:3.4.0
+--- com.android.support:appcompat-v7:23.4.0
|    +--- com.android.support:animated-vector-drawable:23.4.0
|    |    \--- com.android.support:support-vector-drawable:23.4.0
|    |         \--- com.android.support:support-v4:23.4.0 (*)
|    +--- com.android.support:support-v4:23.4.0 (*)
|    \--- com.android.support:support-vector-drawable:23.4.0 (*)
+--- com.android.support:design:23.4.0
|    +--- com.android.support:recyclerview-v7:23.4.0
|    |    +--- com.android.support:support-annotations:23.4.0
|    |    \--- com.android.support:support-v4:23.4.0 (*)
|    +--- com.android.support:appcompat-v7:23.4.0 (*)
|    \--- com.android.support:support-v4:23.4.0 (*)
+--- com.android.support:recyclerview-v7:23.4.0 (*)
+--- com.android.support:support-vector-drawable:23.4.0 (*)
+--- com.android.support:gridlayout-v7:23.4.0
|    \--- com.android.support:support-v4:23.4.0 (*)
+--- com.android.support.constraint:constraint-layout:1.0.0-alpha3
|    \--- com.android.support.constraint:constraint-layout-solver:1.0.0-alpha3
+--- com.google.android.gms:play-services-base:9.0.2
|    +--- com.google.android.gms:play-services-basement:9.0.2
|    |    \--- com.android.support:support-v4:23.0.0 -> 23.4.0 (*)
|    +--- com.google.firebase:firebase-common:9.0.2
|    |    +--- com.google.android.gms:play-services-basement:9.0.2 (*)
|    |    \--- com.google.android.gms:play-services-tasks:9.0.2
|    |         \--- com.google.android.gms:play-services-basement:9.0.2 (*)
|    \--- com.google.android.gms:play-services-tasks:9.0.2 (*)
+--- com.google.code.gson:gson:2.6.2
+--- ch.halarious:halarious-core:0.14
|    \--- com.google.code.gson:gson:2.2.4 -> 2.6.2
+--- com.jakewharton:butterknife:8.0.1
|    +--- com.jakewharton:butterknife-annotations:8.0.1 (*)
|    \--- com.android.support:support-annotations:23.3.0 -> 23.4.0
+--- com.jakewharton.timber:timber:4.1.2
+--- com.aurelhubert:ahbottomnavigation:1.2.3
|    \--- com.android.support:design:23.2.1 -> 23.4.0 (*)
+--- com.squareup.okio:okio:1.8.0
+--- com.squareup.okhttp3:okhttp:3.3.0
|    \--- com.squareup.okio:okio:1.8.0
+--- com.squareup.okhttp3:logging-interceptor:3.3.0
|    \--- com.squareup.okhttp3:okhttp:3.3.0 (*)
+--- com.squareup.retrofit2:retrofit:2.0.2
|    \--- com.squareup.okhttp3:okhttp:3.2.0 -> 3.3.0 (*)
+--- com.squareup.retrofit2:converter-gson:2.0.2
|    +--- com.squareup.retrofit2:retrofit:2.0.2 (*)
|    \--- com.google.code.gson:gson:2.6.1 -> 2.6.2
+--- com.squareup.retrofit2:adapter-rxjava:2.0.2
|    +--- com.squareup.retrofit2:retrofit:2.0.2 (*)
|    \--- io.reactivex:rxjava:1.1.1 -> 1.1.5
+--- com.squareup.picasso:picasso:2.5.2
+--- com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2
|    +--- com.squareup.picasso:picasso:2.5.2
|    \--- com.squareup.okhttp3:okhttp:3.0.1 -> 3.3.0 (*)
+--- io.reactivex:rxjava:1.1.5
+--- io.reactivex:rxandroid:1.2.0
|    \--- io.reactivex:rxjava:1.1.4 -> 1.1.5
+--- nl.littlerobots.rxlint:rxlint:1.0
+--- com.artemzin.rxjava:proguard-rules:1.1.5.0
+--- com.squareup.sqldelight:runtime:0.3.2
|    \--- com.android.support:support-annotations:23.1.1 -> 23.4.0
+--- com.android.support:support-annotations:23.1.1 -> 23.4.0
\--- javax.annotation:jsr250-api:1.0

@rharter
Copy link
Owner

rharter commented Jun 14, 2016

As outlined, the problem is dagger. You need to add apt 'com.squareup:javapoet:1.7.0' to your code.

@aegis123
Copy link

aegis123 commented Jun 14, 2016

When I have this in my dependencies I get the error. I

def daggerVersion = '2.4'
apt "com.google.dagger:dagger-compiler:${daggerVersion}"
compile "com.google.dagger:dagger:${daggerVersion}"
provided 'javax.annotation:jsr250-api:1.0' 
compile 'com.google.guava:guava:19.0'

apt 'com.squareup:javapoet:1.7.0'
provided 'com.squareup:javapoet:1.7.0'

// Code generation
def autoValueVersion = '1.2'
def autoValueParcelVersion = '0.2.2'
def autoValueGsonVersion = '0.3.1'
def autoValueRedactVersion = '1.0.0'
apt "com.google.auto.value:auto-value:${autoValueVersion}"
provided "com.google.auto.value:auto-value:${autoValueVersion}" 
apt "com.ryanharter.auto.value:auto-value-parcel:${autoValueParcelVersion}"
provided "com.ryanharter.auto.value:auto-value-parcel:${autoValueParcelVersion}"
apt "com.ryanharter.auto.value:auto-value-gson:${autoValueGsonVersion}"
provided "com.ryanharter.auto.value:auto-value-gson:${autoValueGsonVersion}"
apt "com.squareup.auto.value:auto-value-redacted:${autoValueRedactVersion}"
provided "com.squareup.auto.value:auto-value-redacted:${autoValueRedactVersion}" 

// Optionally for TypeAdapter support
compile "com.ryanharter.auto.value:auto-value-parcel-adapter:${autoValueParcelVersion}"

@gabrielittner
Copy link
Contributor

Try adding apt 'com.squareup:javapoet:1.7.0' before dagger, otherwise the version bundled in dagger will be on the classpath.

@aegis123
Copy link

thx that works.

@peter-tackage
Copy link

peter-tackage commented Sep 27, 2016

I've observed the error when I had an incorrect AutoValue'd class definition, for example when my Builder definition does not match the data class definition.

Correcting the AutoValue definition fixed the error.

This was the error reported:

SomeRandomClass.java:27: error: package com.ryanharter.auto.value.gson does not exist
import com.ryanharter.auto.value.gson.AutoValueGsonTypeAdapterFactory;
^
MyAutoValueClass.java:30: error: Parameter type of setter method should be int to match getter MyAutoValueClass.type
Builder type(@nonnull Type type);
^

My definition incorrectly had: public abstract int type(); - NB int, not Type.

I was using:

  • Javapoet 1.7 before,
  • Dagger 2.4
  • Auto-Gson :0.3.2-rc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants