auto-value

Proguard with Autovalue

感情迁移 提交于 2019-12-05 21:00:02
问题 I have just started using AutoValue but I am unable to make it work with proguard. I have around 6000+ warnings that look like this Warning:autovalue.shaded.com.google.common.auto.common.MoreElements$1: can't find superclass or interface javax.lang.model.util.SimpleElementVisitor6 The actually errors shows this... Error:Execution failed for task ':transformClassesAndResourcesWithProguardForDebug'. java.io.IOException: Please correct the above warnings first. How can i resolve this issue? 回答1:

Eclipse AutoValue class fails to build

走远了吗. 提交于 2019-12-05 12:11:24
I'm running Eclipse Kepler SR2, with Maven 3.1.1 attached with the m2e and m2e-apt plugins, and I'm getting an error I don't know how to resolve. I managed to find all the dependencies needed to get @AutoValue working into my pom.xml, but now I'm in a state where it only works if the methods which need to be defined all have primitive return types. If I provide an abstract getter which returns an Object or more specific, I get this error: @AutoValue processor threw an exception: java.lang.IllegalArgumentException: Failed to invoke com.google.auto.value.processor.AutoValueProcessor$Property

Android Room Persistence library entity with AutoValue

狂风中的少年 提交于 2019-12-03 12:17:56
Is it possible to use both Room persistence library 's @Entity with AutoValue 's @AutoValue and builder on the same POJO? How should i do it? AFAIK, as of 1.0.0-alpha3 , this is not possible. Room wants fields; AutoValue doesn't expose fields. Keep tabs on this feature request for progress in this area. This feature will be available in Room 2.1.0 https://issuetracker.google.com/issues/62408420#comment27 Following this task, apparently they added support. I assume it will be possible in the future Room release (probably androidx.room version 2.0.0). Still not merged as part of 2.0.0-beta1

Auto-value-gson with an interface error, register an InstanceCreator?

有些话、适合烂在心里 提交于 2019-12-02 11:13:26
I have an interface class that looks like this. public interface Species { String name(); } And a Human class that implements @AutoValue with a TypeAdapter. @AutoValue public abstract class Human implements Parcelable, Species { public static Human create(String humanVariable) { return new AutoValue_Human(humanVariable); } public static Human create(String name, String humanVariable) { return new AutoValue_Human(name, humanVariable); } public static TypeAdapter<Human> typeAdapter(Gson gson) { return new AutoValue_Human.GsonTypeAdapter(gson); } @SerializedName("name") public abstract String

AutoValue sample: error: cannot find symbol class AutoValue_Animal

时光毁灭记忆、已成空白 提交于 2019-12-02 01:42:54
问题 I'm trying to learn about @AutoValue. I follow the example in https://github.com/google/auto/blob/master/value/userguide/index.md I'm using Android Studio 3.4 I add my gradle dependency implementation 'com.google.auto.value:auto-value-annotations:1.6.6' annotationProcessor 'com.google.auto.value:auto-value:1.6.6' I'm also using classpath 'com.android.tools.build:gradle:3.4.2' and distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip I have my code as below @AutoValue