According to the documentation for @GenerateTypeAdapter:
When this annotation is used, there will be no intermediate AutoValue class generated (as opposed to the default logic, which generates an intermediate class and generates the TypeAdapter as a static inner class of it).
And according to the PR #160:
If the annotation is present, no intermediary AutoValue class will be generated either.
I am getting the following error on the generated type adapter when building my project:
MyClass_GsonTypeAdapter.java:140: error: AutoValue_MyClass(Long,String,String,String) has private access in AutoValue_MyClass
return new AutoValue_MyClass(id, body, subject, type);
^
What is strange is that the non-existent AutoValue_MyClass class is referenced in the generated type adapter constructor earlier in the file but no error is thrown for that:
@GenerateTypeAdapter
@AutoValue
public abstract class MyClass {
...
public static TypeAdapter<MyClass> typeAdapter(Gson gson) {
return new MyClass_GsonTypeAdapter(gson);
}
...
}
Is there something I'm doing incorrectly that this is getting generated to reference a non-existent class? Or do you know of a fix?
According to the documentation for
@GenerateTypeAdapter
:And according to the PR #160:
I am getting the following error on the generated type adapter when building my project:
What is strange is that the non-existent
AutoValue_MyClass
class is referenced in the generated type adapter constructor earlier in the file but no error is thrown for that:MyClass looks like this:
Is there something I'm doing incorrectly that this is getting generated to reference a non-existent class? Or do you know of a fix?