[FIXED] Proguard with Android gives me JNI error

Issue

After using ProGuard on Android application with some native (JNI, C++) code – application crashes in loading process. Message:

* * Build fingerprint:
‘Xiaomi/markw/markw:6.0.1/MMB29M/V8.2.4.0.MBEMIDL:user/release-keys’
Revision: ‘0’ ABI: ‘arm’ pid: 15075, tid: 15115, name: Thread-10486

com.mynamespace.myapp <<< signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr ——– Abort message:
‘art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION:
use of deleted global reference 0xe5617166’
r0 00000000 r1 00003b0b r2 00000006 r3 de161978
r4 de161980 r5 de161930 r6 0000000b r7 0000010c
r8 ab4446c8 r9 f52d7378 sl 00000000 fp 00000000
ip 00000006 sp de1609f8 lr f7360f5d pc f7363358 cpsr 40070010

backtrace:
#00 pc 00044358 /system/lib/libc.so (tgkill+12)
#01 pc 00041f59 /system/lib/libc.so (pthread_kill+32)
#02 pc 0001ba6f /system/lib/libc.so (raise+10)
#03 pc 00018c11 /system/lib/libc.so (__libc_android_abort+34)
#04 pc 000167d0 /system/lib/libc.so (abort+4)
#05 pc 00321145 /system/lib/libart.so (_ZN3art7Runtime5AbortEv+212)
#06 pc 000f3cdd /system/lib/libart.so (_ZN3art10LogMessageD2Ev+2212)
#07 pc 0024f817 /system/lib/libart.so (ZN3art9JavaVMExt8JniAbortEPKcS2+1526)
#08 pc 0024fc21 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+68)
#09 pc 0033e107 /system/lib/libart.so (_ZNK3art6Thread13DecodeJObjectEP8_jobject+686)
#10 pc 0031a031 /system/lib/libart.so (_ZN3art17InvokeWithVarArgsERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDSt9__va_list+248)
#11 pc 0028e30d /system/lib/libart.so (_ZN3art3JNI10NewObjectVEP7_JNIEnvP7_jclassP10_jmethodIDSt9__va_list+1064)
#12 pc 0010724f /system/lib/libart.so (_ZN3art8CheckJNI10NewObjectVEP7_JNIEnvP7_jclassP10_jmethodIDSt9__va_list+866)
#13 pc 00093768 /data/app/com.mynamespace.myapp-1/lib/arm/librhodes.so

Any ideas, what am I doing wrong?

Solution

The right answer is “Use logcat with adb to catch normal log”. This is the best way, I think.

adb -e logcat > output.txt

Of course that was the problem with reflection api and renaming private methods.

Answered By – Hramovnik

Answer Checked By – Robin (Easybugfix Admin)

Leave a Reply

(*) Required, Your email will not be published