ActiveAndroid icon indicating copy to clipboard operation
ActiveAndroid copied to clipboard

Initialization problem when do obfuscation using ProGuard.

Open ankit1234 opened this issue 10 years ago • 2 comments

Hi,

I am using ActiveAndroid in my Android Application. But Having problem during initialization with ActiveAndroid.initialize(this) in my application class. When I am opening application I am getting below NullPointer exception,

12-10 17:41:18.433: E/AndroidRuntime(2266): java.lang.RuntimeException: Unable to create application ecc2.plmsolutions.eu.ECC2Application: java.lang.NullPointerException: Attempt to invoke interface method 'int com.activeandroid.annotation.Column.length()' on a null object reference

Actually this happening only when I am generating signed apk with pro-guard. (to obfuscate my application code)

If I will not use proguard then working fine. So please let me know what should I do in such case. [ My proguard.cfg file content, -keep class com.activeandroid.** { ; } -keep class com.activeandroid.__.* { *; } -keep class * extends com.activeandroid.Model -keep class * extends com.activeandroid.serializer.TypeSerializer]

Thanks, Ankit

ankit1234 avatar Dec 10 '15 13:12 ankit1234

Hi, I got solution by my self. -keepattributes Annotation this is required. For more information we can check http://stackoverflow.com/questions/7378693/proguard-and-annotations

Thanks

ankit1234 avatar Dec 11 '15 10:12 ankit1234

Same of me but I already use -keepattributes Annotation and the application still crash

ROMDEMBELE avatar Oct 23 '19 12:10 ROMDEMBELE