rharter / auto-value-gson

AutoValue Extension to add Gson De/Serializer support
Apache License 2.0
607 stars 103 forks source link

Problems when using with auto-value-parcel #46

Closed lhoracek closed 8 years ago

lhoracek commented 8 years ago

Whe I use this auto-value-gson version 0.3.1 together with auto-value-parcel 0.2.1 I end with exception with multiple warnings before. Probably trying to process parcelable methods as well?

When I revert to verzion 0.2.5 of auto-value-gson it works fine. But I expected TypeAdapterFactory to be generated by the new version.

warning: @AutoValue classes cannot have abstract methods other than property getters and Builder converters

Caused by: java.lang.NoSuchMethodError: com.squareup.javapoet.TypeSpec.classBuilder(Lcom/squareup/javapoet/ClassName;)Lcom/squareup/javapoet/TypeSpec$Builder; at com.ryanharter.auto.value.gson.AutoValueGsonAdapterFactoryProcessor.createTypeAdapterFactory(AutoValueGsonAdapterFactoryProcessor.java:82) at com.ryanharter.auto.value.gson.AutoValueGsonAdapterFactoryProcessor.process(AutoValueGsonAdapterFactoryProcessor.java:67) at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705) at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91) at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856) at com.sun.tools.javac.main.Main.compile(Main.java:523) ... 88 more

rharter commented 8 years ago

Looks like the warning isn't the issue, that's a known bug in AutoValue that'll be fixed in the next version.

Looks like the issue is with JavaPoet. Are you including JavaPoet in your project anywhere? Could you share your gradle dependencies?

lhoracek commented 8 years ago

Using databinding and trying to update the version of auto-value-gson to 0.3.1 with those dependencies:

Versions:

google_play_services_library=8.4.0 google_support_library=23.4.0 core_version=0.5.1 stetho_version=1.3.1 auto_value_version=1.2 dagger_lib_version=2.2

And dependencies are:

compile "com.android.support:design:${google_support_library}"
compile "com.android.support:recyclerview-v7:${google_support_library}"
compile "com.android.support:cardview-v7:${google_support_library}"
compile "com.google.android.gms:play-services-fitness:${google_play_services_library}"
compile "com.google.android.gms:play-services-drive:${google_play_services_library}"
compile "com.google.code.gson:gson:2.6.2"
compile "com.github.paolorotolo:appintro:3.4.0"
compile 'com.wdullaer:materialdatetimepicker:2.3.0'
provided "org.glassfish:javax.annotation:10.0-b28"

compile "com.felipecsl:gifimageview:2.0.0"
compile "commons-io:commons-io:2.5"

//RxAndroid
compile "io.reactivex:rxandroid:1.2.0"
compile "io.reactivex:rxjava:1.1.5"

//Retrofit
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.github.pwittchen:weathericonview:1.1.0'

//dagger2
apt "com.google.dagger:dagger-compiler:$dagger_lib_version"
compile "com.google.dagger:dagger:$dagger_lib_version"

provided "com.google.auto.value:auto-value:${auto_value_version}"
apt "com.google.auto.value:auto-value:${auto_value_version}"
apt 'com.ryanharter.auto.value:auto-value-parcel:0.2.1'
apt 'com.ryanharter.auto.value:auto-value-gson:0.2.5'

//core lib
debugliteCompile("com.facebook.stetho:stetho:${stetho_version}")
debugCompile("com.facebook.stetho:stetho:${stetho_version}")

//pro libs ( greeddao + sqlcipher )
//base for all lite/pro
compile(name: 'cipher-lib-base-release', ext: 'aar')
// without sqlcihper
debugliteCompile(name: 'cipher-lib-lite-release', ext: 'aar')
// with sqlcihper
debugCompile(name: 'cipher-lib-pro-release', ext: 'aar')
debugCompile 'commons-codec:commons-codec:1.10'
debugCompile(name: 'sqlcipher', ext: 'aar')
releaseCompile(name: 'cipher-lib-pro-release', ext: 'aar')
releaseCompile 'commons-codec:commons-codec:1.10'
releaseCompile(name: 'sqlcipher', ext: 'aar')

//glide
compile 'com.github.bumptech.glide:glide:3.7.0'
rharter commented 8 years ago

Please get your dependencies by running ./gradlew <module>:dependencies and getting the apt: section.

lhoracek commented 8 years ago

apt +--- com.google.dagger:dagger-compiler:2.2 | +--- com.google.dagger:dagger:2.2 | | --- javax.inject:javax.inject:1 | +--- com.google.dagger:dagger-producers:2.2 | | +--- com.google.dagger:dagger:2.2 () | | --- 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.1 | +--- com.squareup:javapoet:1.4.0 | +--- 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.google.auto.value:auto-value:1.2-rc1 -> 1.2 | --- com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.1 +--- com.ryanharter.auto.value:auto-value-gson:0.2.5 | +--- com.squareup:javapoet:1.1.0 -> 1.4.0 | +--- com.google.code.gson:gson:2.4 -> 2.6.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 () +--- 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:recyclerview-v7:23.4.0 () +--- com.android.support:cardview-v7:23.4.0 +--- com.google.android.gms:play-services-fitness: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.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 | --- com.google.android.gms:play-services-base:8.4.0 () +--- com.google.android.gms:play-services-drive:8.4.0 | --- com.google.android.gms:play-services-base:8.4.0 () +--- com.google.code.gson:gson:2.6.2 +--- com.github.paolorotolo:appintro:3.4.0 | +--- com.android.support:support-annotations:23.1.1 -> 23.4.0 | +--- com.android.support:appcompat-v7:23.1.1 -> 23.4.0 () | --- com.android.support:support-v4:23.1.1 -> 23.4.0 () +--- com.wdullaer:materialdatetimepicker:2.3.0 | --- com.android.support:support-v4:23.1.1 -> 23.4.0 () +--- com.felipecsl:gifimageview:2.0.0 | --- com.android.support:support-annotations:23.1.0 -> 23.4.0 +--- commons-io:commons-io:2.5 +--- io.reactivex:rxandroid:1.2.0 | --- io.reactivex:rxjava:1.1.4 -> 1.1.5 +--- io.reactivex:rxjava:1.1.5 +--- com.squareup.retrofit2:retrofit:2.0.2 | --- com.squareup.okhttp3:okhttp:3.2.0 | --- com.squareup.okio:okio:1.6.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.okhttp3:logging-interceptor:3.2.0 | --- com.squareup.okhttp3:okhttp:3.2.0 () +--- com.github.pwittchen:weathericonview:1.1.0 +--- com.google.dagger:dagger:2.2 () +--- :cipher-lib-base-release: +--- com.github.bumptech.glide:glide:3.7.0 +--- com.android.databinding:library:1.1 | +--- com.android.support:support-v4:21.0.3 -> 23.4.0 () | --- com.android.databinding:baseLibrary:1.1 -> 2.1.0 +--- com.android.databinding:baseLibrary:2.1.0 +--- com.android.databinding:adapters:1.1 | +--- com.android.databinding:library:1.1 () | --- com.android.databinding:baseLibrary:1.1 -> 2.1.0 +--- org.glassfish:javax.annotation:10.0-b28 --- com.android.databinding:compiler:2.1.0 +--- com.android.databinding:baseLibrary:2.1.0 --- com.googlecode.juniversalchardet:juniversalchardet:1.0.3

lhoracek commented 8 years ago

And after I rise the version to 0.3.1: 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.1 | +--- com.squareup:javapoet:1.4.0 -> 1.7.0 | +--- 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.google.auto.value:auto-value:1.2-rc1 -> 1.2 | --- com.ryanharter.auto.value:auto-value-parcel-adapter:0.2.1 +--- 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.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:recyclerview-v7:23.4.0 () +--- com.android.support:cardview-v7:23.4.0 +--- com.google.android.gms:play-services-fitness: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.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 | --- com.google.android.gms:play-services-base:8.4.0 () +--- com.google.android.gms:play-services-drive:8.4.0 | --- com.google.android.gms:play-services-base:8.4.0 () +--- com.google.code.gson:gson:2.6.2 +--- com.github.paolorotolo:appintro:3.4.0 | +--- com.android.support:support-annotations:23.1.1 -> 23.4.0 | +--- com.android.support:appcompat-v7:23.1.1 -> 23.4.0 () | --- com.android.support:support-v4:23.1.1 -> 23.4.0 () +--- com.wdullaer:materialdatetimepicker:2.3.0 | --- com.android.support:support-v4:23.1.1 -> 23.4.0 () +--- com.felipecsl:gifimageview:2.0.0 | --- com.android.support:support-annotations:23.1.0 -> 23.4.0 +--- commons-io:commons-io:2.5 +--- io.reactivex:rxandroid:1.2.0 | --- io.reactivex:rxjava:1.1.4 -> 1.1.5 +--- io.reactivex:rxjava:1.1.5 +--- com.squareup.retrofit2:retrofit:2.0.2 | --- com.squareup.okhttp3:okhttp:3.2.0 | --- com.squareup.okio:okio:1.6.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.okhttp3:logging-interceptor:3.2.0 | --- com.squareup.okhttp3:okhttp:3.2.0 () +--- com.github.pwittchen:weathericonview:1.1.0 +--- com.google.dagger:dagger:2.4 () +--- :cipher-lib-base-release: +--- com.github.bumptech.glide:glide:3.7.0 +--- com.android.databinding:library:1.1 | +--- com.android.support:support-v4:21.0.3 -> 23.4.0 () | --- com.android.databinding:baseLibrary:1.1 -> 2.1.0 +--- com.android.databinding:baseLibrary:2.1.0 +--- com.android.databinding:adapters:1.1 | +--- com.android.databinding:library:1.1 () | --- com.android.databinding:baseLibrary:1.1 -> 2.1.0 +--- org.glassfish:javax.annotation:10.0-b28 --- com.android.databinding:compiler:2.1.0 +--- com.android.databinding:baseLibrary:2.1.0 --- com.googlecode.juniversalchardet:juniversalchardet:1.0.3

So now it upgrades the javapoet for parcel plugin.

rharter commented 8 years ago

I've just released auto-value-parcel 0.2.2 (might take 10 minutes or so). Give that a try and see if it solves the issue.

lhoracek commented 8 years ago

Now I have the same issue with Error:Execution failed for task ':app:compileDevDebugJavaWithJavac'.

java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSetMultimap$Builder.putAll(Ljava/lang/Iterable;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;

Probably caused by Dagger using Guava 19:

+--- 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.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

lhoracek commented 8 years ago

The reason is I updated to dagger 2.4 lately.

lhoracek commented 8 years ago

I made example app, that replicates the problem: https://github.com/lhoracek/autoValueTest Uses dagger 2.4 and autovalue 1.2 with auto-value-parcel 0.2.2 and auto-value-gson 0.3.1

lhoracek commented 8 years ago

Any news on that with this example project?

skrzyneckik commented 8 years ago

@rharter @lhoracek due what I found, it's a conflict with dagger-producers extensions - auto-value-gson works fine with dagger 2.0.2 - 2.4, but when dagger-producers (any version) is added as extra dependency to project following exception is thrown.

Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

lhoracek commented 8 years ago

I have problem when I combine auto-value-parcel 0.2.2 and auto-value-gson 0.3.1. Older versions were without any problems. (0.2.1 and 0.2.5)

rharter commented 8 years ago

@skrzyneckik your problem is you are hitting the dex limit, which is different than this ticket. Make sure you're adding those dependencies to the apt config, not compile.

@lhoracek The issue you're seeing is a result of Dagger including JavaPoet incorrectly in their source. Check #43 for discussion and solution.

skrzyneckik commented 8 years ago

@rharter Dagger and dagger-producers are added as compile dependency as it's been mentioned here and only dagger-compiler is added as apt dependency.

I need to say it's suspicious with this DexIndexOverflowException which I mentioned - I guess it was internal Android Studio problem, because when I've cleaned project it disappeared and another showed up

Execution failed for task ':app:compileDebugJavaWithJavac'. java.lang.IllegalStateException

Here is stacktrace:

  • Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:68) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) Caused by: java.lang.RuntimeException: java.lang.IllegalStateException at com.sun.tools.javac.main.Main.compile(Main.java:553) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:46) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:104) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:53) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25) at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:163) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:145) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:93) at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:49) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) ... 14 more Caused by: java.lang.IllegalStateException at dagger.internal.codegen.BindingGraphValidator$Validation.validateComponentScope(BindingGraphValidator.java:897) at dagger.internal.codegen.BindingGraphValidator$Validation.validateSubgraph(BindingGraphValidator.java:257) at dagger.internal.codegen.BindingGraphValidator.validate(BindingGraphValidator.java:1188) at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:138) at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:46) at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:318) at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:171) at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705) at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91) at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856) at com.sun.tools.javac.main.Main.compile(Main.java:523) ... 34 more

And apt dependecies:

+--- 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-adapter:0.2.2 +--- 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.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 | +--- com.squareup:javapoet:1.7.0 | --- com.google.code.gson:gson:2.6.2

JakeWharton commented 8 years ago

That's a Dagger bug.

Also producers depends on Guava so it's not surprising you exceeded the dex method limit.

On Thu, Jun 9, 2016 at 4:08 PM Krzysztof Skrzynecki < notifications@github.com> wrote:

@rharter https://github.com/rharter Dagger and dagger-producers are added as compile dependency as it's been mentioned here https://github.com/google/dagger and only dagger-compiler is added as apt dependency.

Moreover, in my project I'm not using auto-value-parcel -

I need to say it's suspicious with this DexIndexOverflowException which I mentioned - I guess it was internal Android Studio problem, because when I've cleaned project it disappeared and another showed up

Execution failed for task ':app:compileDebugJavaWithJavac'. java.lang.IllegalStateException

Here is stacktrace:

  • Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:68) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) Caused by: java.lang.RuntimeException: java.lang.IllegalStateException at com.sun.tools.javac.main.Main.compile(Main.java:553) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:46) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:104) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:53) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25) at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:163) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:145) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:93) at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:49) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) ... 14 more Caused by: java.lang.IllegalStateException at dagger.internal.codegen.BindingGraphValidator$Validation.validateComponentScope(BindingGraphValidator.java:897) at dagger.internal.codegen.BindingGraphValidator$Validation.validateSubgraph(BindingGraphValidator.java:257) at dagger.internal.codegen.BindingGraphValidator.validate(BindingGraphValidator.java:1188) at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:138) at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:46) at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:318) at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:171) at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705) at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91) at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856) at com.sun.tools.javac.main.Main.compile(Main.java:523) ... 34 more

And apt dependecies:

+--- 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-adapter:0.2.2 +--- 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.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

| +--- com.squareup:javapoet:1.7.0 | --- com.google.code.gson:gson:2.6.2

You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub https://github.com/rharter/auto-value-gson/issues/46#issuecomment-225011135, or mute the thread https://github.com/notifications/unsubscribe/AAEEESK6nTnWtR6__aiq7E7qFpXT-Mryks5qKHLEgaJpZM4InnX3 .