Tickaroo / tikxml

Modern XML Parser for Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeAdapter Not found exception

SindhuKonda opened this issue · comments

I am working on Android project.

@xml(name = "Info")
public class Info {

@Attribute(name="type")
String type;
@Attribute(name="id")
String id;
@Attribute(name = "date")
String date;

}

Added below dependencies in build file
--------------------------------------------------------------
compile "com.tickaroo.tikxml:annotation:0.8.13"
compile "com.tickaroo.tikxml:core:0.8.13"
annotationProcessor "com.tickaroo.tikxml:processor:0.8.13"

compile 'com.squareup.retrofit2:retrofit:2.4.0'
compile "com.tickaroo.tikxml:retrofit-converter:0.8.13"

Added below proguard rules
------------------------------------------
-keep class com.tickaroo.tikxml.** { *; }
-keep @com.tickaroo.tikxml.annotation.Xml public class *
-keep class **$$TypeAdapter { *; }

-keepclasseswithmembernames class * {
@com.tickaroo.tikxml.* ;
}
-keepclasseswithmembernames class * {
@com.tickaroo.tikxml.* ;
}

Still, Application is not generating Type adapter class for Info class. Am I missing any thing else?

Not sure if it's just a typo here on github but it's @Xml and not @xml ...

Also, please check if there is a TypeAdapter class in app/build/source/generated/apt/.

Yeah its typo. Its @Xml only

I have checked in generated folder. but didn't find $$TypeAdapter class.

Do we need to specify any apt version?

Yes, I am using Dagger in my project

//Dagger dependencies
compile 'com.google.dagger:dagger:2.2'
apt "com.google.dagger:dagger-compiler:2.2"
provided 'org.glassfish:javax.annotation:10.0-b28'
compile 'javax.inject:javax.inject:1@jar'

Dagger related files are generated.

Hmm... What will happen when you replace plugin android-apt with builtin android annotationProcessor?

Its working if we replace apt with annotationProcessor. Thank you.

I was a bit surprised that Android Gradle Plugin didn't warn you to use annotationProcessor.