I am testing a demo of an integration, it is an ionic application (with cordova) I created the android platform and when I run it on emulators with API 26, 30 or 31, it works correctly; but I find that when testing on a physical device (API 31) as soon as I open it, it loads the splash and then closes.
I add the code that shows the terminal, I have searched in several forums and none of the solutions seem to fit my problem
I/chromium: [INFO:CONSOLE(100770)] "Ionic Native: deviceready event fired after 2039 ms", source: http://localhost/vendor-es2015.js (100770)
W/KeyStore: KeyStore exception
android.os.ServiceSpecificException: (code 7)
at android.os.Parcel.createExceptionOrNull(Parcel.java:2387)
at android.os.Parcel.createException(Parcel.java:2357)
at android.os.Parcel.readException(Parcel.java:2340)
at android.os.Parcel.readException(Parcel.java:2282)
at android.security.keystore.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:988)
at android.security.KeyStore.get(KeyStore.java:233)
at android.security.KeyStore.get(KeyStore.java:222)
at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificate(AndroidKeyStoreSpi.java:160)
at java.security.KeyStore.getCertificate(KeyStore.java:1120)
at com.crypho.plugins.RSA.loadKey(RSA.java:71)
at com.crypho.plugins.RSA.isEntryAvailable(RSA.java:51)
at com.crypho.plugins.SecureStorage.execute(SecureStorage.java:105)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:117)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:342)
at android.os.Looper.loop(Looper.java:197)
at android.os.HandlerThread.run(HandlerThread.java:67)
W/KeyStore: KeyStore exception
android.os.ServiceSpecificException: (code 7)
at android.os.Parcel.createExceptionOrNull(Parcel.java:2387)
at android.os.Parcel.createException(Parcel.java:2357)
at android.os.Parcel.readException(Parcel.java:2340)
at android.os.Parcel.readException(Parcel.java:2282)
at android.security.keystore.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:988)
at android.security.KeyStore.get(KeyStore.java:233)
at android.security.KeyStore.get(KeyStore.java:222)
at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificate(AndroidKeyStoreSpi.java:165)
at java.security.KeyStore.getCertificate(KeyStore.java:1120)
at com.crypho.plugins.RSA.loadKey(RSA.java:71)
at com.crypho.plugins.RSA.isEntryAvailable(RSA.java:51)
at com.crypho.plugins.SecureStorage.execute(SecureStorage.java:105)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:117)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:342)
at android.os.Looper.loop(Looper.java:197)
at android.os.HandlerThread.run(HandlerThread.java:67)
W/PluginManager: THREAD WARNING: exec() call to SecureStorage.init blocked the main thread for 42ms. Plugin should use CordovaInterface.getThreadPool().
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ionicframework.suacimobile257509, PID: 22032
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.credentials.UNLOCK }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2067)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1727)
at android.app.Activity.startActivityForResult(Activity.java:5412)
at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:345)
at android.app.Activity.startActivityForResult(Activity.java:5370)
at android.app.Activity.startActivity(Activity.java:5760)
at android.app.Activity.startActivity(Activity.java:5713)
at com.crypho.plugins.SecureStorage.startActivity(SecureStorage.java:240)
at com.crypho.plugins.SecureStorage.access$700(SecureStorage.java:21)
at com.crypho.plugins.SecureStorage$4.run(SecureStorage.java:217)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:250)
at android.app.ActivityThread.main(ActivityThread.java:7803)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
D/SERVER: Handling local request: http://localhost/7-es2015.js
I/Process: Sending signal. PID: 22032 SIG: 9
CodePudding user response:
I managed to solve the problem by focusing on this line
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.credentials.UNLOCK }
It turns out that it is a matter of one of the dependencies that fails in some cases yes and others no from API 28, I add the link from where I was guided
https://github.com/Crypho/cordova-plugin-secure-storage/issues/169#issuecomment-509734410