Error in Parceler lib annotation

Asked

Viewed 58 times

1

I’m implementing a class that implements Parcelable and I’m using the lib Parceler, but when I run the application appears the following error:

Error:Execution failed for task ':app:javaPreCompileDebug'. Annotation Processors must be explicitly declared now. The following dependencies on the Compile classpath are found to contain Annotation Processor. Please add them to the annotationProcessor Configuration. - parceler-1.0.3.jar (org.parceler:parceler:1.0.3) Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with Previous behavior. Note that this option is deprecated and will be Removed in the Future. See https://developer.android.com/r/tools/annotation-processor-error-message.html for more Details.

How the error is showing is a problem in the annotation I made in the class, but I can’t understand what is wrong.

 @org.parceler.Parcel

public class Carro
{
   //Atributos da classe
   private static final long serialVersionUID = 6601006766832473959L;
   public long id;
   public String tipo;
   public String nome;
   public String desc;
   public String urlFoto;
   public String urlInfo;
   public String urlVideo;
   public String urlLatitude;
   public String urlLongitude;

   @Override
   public String toString() {
      return "Carro{" + "nome-'" + nome + "/" + "}";
   }

}

And in the build.gradle :

implementation 'org.parceler:parceler:1.0.3'
implementation 'org.parceler:parceler-api:1.0.3'

If anyone can help me, I’d appreciate it :)

1 answer

0

According to the Github do Parceler, To use Parceler you have to use these 2 lines in Gradle:

implementation 'org.parceler:parceler-api:1.1.9'
annotationProcessor 'org.parceler:parceler:1.1.9'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.