Closed DieterVDW closed 4 years ago
Ironically, I also get this error when I try it on the following class (only file in the module):
public class Foo { }
This is my pom (apart from this there is only the artifact details in the pom, nothing else):
<dependencies>
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>com.ryanharter.auto.value</groupId>
<artifactId>auto-value-gson</artifactId>
<version>1.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
<!--
<annotationProcessorPaths>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>1.7</version>
</path>
</annotationProcessorPaths>
-->
</configuration>
</plugin>
</plugins>
</build>
When I uncomment the annotationProcessorsPath
section I get the following error (using the Foo class code from the first post):
[ERROR] /Users/dieterpersonal/Google Drive/AudioHarvest/Code/AudioHarvest/model/src/main/java/com/ascentinel/audioharvest/model/Foo.java:[27,29] cannot find symbol
symbol: class GsonTypeAdapter
location: class com.ascentinel.audioharvest.model.AutoValue_Foo
Totally clueless here, this seems like the absolute minimal testcase? Any ideas what could be wrong with my build?
In fact simply adding the dependency to any module makes the module fail with this error...
Much ado about nothing! If I had read the part about the gradle dependencies in my enthousiasm, I could have found I had to actually add the annotation processors!
It works absolutely brilliantly now.
This is my first time using
auto-value-gson
and it looks perfect for what I want to do, but unfortunately I can't get my code to work.I refactored until I got a testcase that looks identical to the code in the readme and the classes in the example directory, however I still can't get it to work.
This is my testcase:
When trying to compile this, I get the following error:
Some specs:
I'm probably doing something wrong, but it's not obvious to me. Any tips?