Closed Wxianpeng closed 5 years ago
增加 混淆 代码 。 就不会闪退了。。。 -dontwarn com.kongqw. -keep class com.kongqw.{*;}
也是关闭串口的时候报错
if (null != mFd) {
close();
mFd = null;
}
这个close这里
567 2658-2691/? E/art: JNI DETECTED ERROR IN APPLICATION: fid == null 2020-05-22 11:39:11.567 2658-2691/? E/art: in call to GetObjectField 2020-05-22 11:39:11.567 2658-2691/? E/art: from void com.kongqw.serialportlibrary.SerialPort.close() 2020-05-22 11:39:11.567 2658-2691/? E/art: "Timer-2" prio=5 tid=18 Runnable 2020-05-22 11:39:11.567 2658-2691/? E/art: | group="main" sCount=0 dsCount=0 obj=0x12f2fca0 self=0xb16ac600 2020-05-22 11:39:11.567 2658-2691/? E/art: | sysTid=2691 nice=0 cgrp=default sched=0/0 handle=0xb2ba6920 2020-05-22 11:39:11.567 2658-2691/? E/art: | state=R schedstat=( 1653461 1101693 8 ) utm=0 stm=0 core=3 HZ=100 2020-05-22 11:39:11.567 2658-2691/? E/art: | stack=0xb2aa4000-0xb2aa6000 stackSize=1038KB 2020-05-22 11:39:11.567 2658-2691/? E/art: | held mutexes= "mutator lock"(shared held) 2020-05-22 11:39:11.567 2658-2691/? E/art: native: #00 pc 0034f0ad /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+128) 2020-05-22 11:39:11.567 2658-2691/? E/art: native: #01 pc 0032f96d /system/lib/libart.so (_ZNK3art6Thread9DumpStackERNSt3113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMap+632) 2020-05-22 11:39:11.567 2658-2691/? E/art: native: #02 pc 00238381 /system/lib/libart.so (ZN3art9JavaVMExt8JniAbortEPKcS2+1188) 2020-05-22 11:39:11.567 2658-2691/? E/art: native: #03 pc 002393db /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+66) 2020-05-22 11:39:11.567 2658-2691/? E/art: native: #04 pc 0026fad3 /system/lib/libart.so (_ZN3art3JNI14GetObjectFieldEP7_JNIEnvP8_jobjectP9_jfieldID+514) 2020-05-22 11:39:11.567 2658-2691/? E/art: native: #05 pc 00000b67 /system/priv-app/rktools/rktools.apk (???) 2020-05-22 11:39:11.567 2658-2691/? E/art: native: #06 pc 0003996f /data/dalvik-cache/arm/system@priv-app@rktools@rktools.apk@classes.dex (Java_com_kongqw_serialportlibrary_SerialPort_close+74) 2020-05-22 11:39:11.567 2658-2691/? E/art: at com.kongqw.serialportlibrary.SerialPort.close(Native method) 2020-05-22 11:39:11.567 2658-2691/? E/art: at com.intelligym.rk3288tools.device.b.a.a(SerialPortManager.java:107) 2020-05-22 11:39:11.567 2658-2691/? E/art: at com.intelligym.rk3288tools.device.b.b.f.l(XQTreadmillSerialPort.java:431) 2020-05-22 11:39:11.567 2658-2691/? E/art: at com.intelligym.rk3288tools.device.b.b.f.i(XQTreadmillSerialPort.java:425) 2020-05-22 11:39:11.568 2658-2691/? E/art: at com.intelligym.rk3288tools.activity.factory.FactoryXqTreadmillActivity$1.run(FactoryXqTreadmillActivity.java:201) 2020-05-22 11:39:11.568 2658-2691/? E/art: at java.util.TimerThread.mainLoop(Timer.java:555) 2020-05-22 11:39:11.568 2658-2691/? E/art: at java.util.TimerThread.run(Timer.java:505)
增加 混淆 代码 。 就不会闪退了。。。 -dontwarn com.kongqw. -keep class com.kongqw.{*;}
这个是怎么增加?在打包的时候?加在gradle配置文件里面啊
at com.kongqw.serialportlibrary.SerialPort.close(Native method) at com.kongqw.serialportlibrary.SerialPortManager.a(SerialPortManager.java:87) at com.ubains.aide.VoiceActivity.onDestroy(VoiceActivity.java:883) at android.app.Activity.performDestroy(Activity.java:6437) at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1142) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3818) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3849) at android.app.ActivityThread.-wrap5(ActivityThread.java:-1) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke!(Native method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:772) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:662)