Android 加载应用报错
JNI DETECTED ERROR IN APPLICATION: JNI NewObjectV called with pending exception java.lang.NoSuchMethodError: no non-static method "Lio/liteglue/SQLiteNativeResponse;.<init>(IJ)V" at io.liteglue.SQLiteNativeResponse io.liteglue.SQLiteNDKNativeDriver.sqlc_db_open(java.lang.String, int) (SQLiteNDKNativeDriver.java:-2) at int h.a.b.e() (SQLGDatabaseHandle.java:14) at void h.a.f.<init>(java.lang.String, int) (SQLiteGlueConnection.java:10) at h.a.d h.a.e.a(java.lang.String, int) (SQLiteConnector.java:20) at void h.b.b.j(java.io.File) (SQLiteConnectorDatabase.java:51) at h.b.a io.sqlc.SQLitePlugin.j(java.lang.String, org.apache.cordova.CallbackContext, boolean) (SQLitePlugin.java:213) at h.b.a io.sqlc.SQLitePlugin.a(io.sqlc.SQLitePlugin, java.lang.String, org.apache.cordova.CallbackContext, boolean) (SQLitePlugin.java:28) at void io.sqlc.SQLitePlugin$d.run() (SQLitePlugin.java:328) at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1167) A/.ronghw.app.ec: java_vm_ext.cc:545] at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:641) at void java.lang.Thread.run() (Thread.java:764) in call to NewObjectV from io.liteglue.SQLiteNativeResponse io.liteglue.SQLiteNDKNativeDriver.sqlc_db_open(java.lang.String, int) "pool-4-thread-3" prio=5 tid=22 Runnable | group="main" sCount=0 dsCount=0 flags=0 obj=0x12c82ea0 self=0xd1843e00 | sysTid=8145 nice=0 cgrp=default sched=0/0 handle=0xcfda0970 | state=R schedstat=( 3457880 17032135 5 ) utm=0 stm=0 core=0 HZ=100 | stack=0xcfc9d000-0xcfc9f000 stackSize=1042KB | held mutexes= "mutator lock"(shared held)
图片展示错误如下
解决方案
我们具体看 “Lio/liteglue/SQLiteNativeResponse;.(IJ)V” 由于项目做了混淆,导致这里出现了问题。所以在混淆时添加
-keep class io.liteglue.** {*; }