In my project, the native library is using reflection to call back into the Java code. So I followed this thread and added the following to proguard-project.txt
-keep class com.example.abc.MainActivity { *; }
-keep class com.example.abc.NativeClass { *; }
to preserve all methods and fields in NativeClass(where all native methods are declared) and Mainactivity where the calls to native methods are made. Within these native methods, again calls are made to NativeClass.java methods(pure java methods) which in turn calls java methods defined in Mainactivity.java. The app runs fine without proguard. But after exporting the project by enabling proguard, the app crashes at points where native method calls(which in turn calls java methods in NativeClass) are made. I have tried all possible commands to enter in proguard-project.txt to no avail. OpenCV methods are called in native code. How should I handle OpenCV native codes when enabling proguard. Please help.
Following are logs from tombstone file
/data/data/com.example.imageanalyse/lib/libfilters.so
be98d7a0 0000f2b8 [heap]
be98d7a4 be98d7b4 [stack]
be98d7a8 56d47798 /dev/ashmem/dalvik-LinearAlloc (deleted)
be98d7ac 5bdb9d6b /data/data/com.example.imageanalyse/lib/libfilters.so
be98d7b0 00000000
be98d7b4 00000000
--------- tail end of log /dev/log/main
09-25 15:20:56.930 3356 3357 D dalvikvm: GC_CONCURRENT freed 18K, 48% free 20256K/38855K,
paused 2ms+8ms
09-25 15:20:56.980 3356 3356 D dalvikvm: GC_FOR_ALLOC freed 5120K, 58% free 16405K/38855K,
paused 22ms
09-25 15:20:57.030 3356 3356 D dalvikvm: GC_FOR_ALLOC freed 1278K, 58% free 16449K/38855K,
paused 22ms
09-25 15:20:57.070 3356 3356 D dalvikvm: GC_FOR_ALLOC freed 1269K, 58% free 16449K/38855K,
paused 22ms
09-25 15:20:57.090 3356 3356 F libc : Fatal signal 11 (SIGSEGV) at 0x00000004 (code=1)
--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---