cordova 我的应用程序在物理设备上启动后立即关闭

n7taea2i  于 2022-11-15  发布在  其他
关注(0)|答案(1)|浏览(177)

我正在测试一个集成的演示,它是一个离子应用程序(与cordova),我创建了android平台,当我运行它的模拟器与API 26,30或31,它的工作正常;但我发现在物理设备(API 31)上测试时,只要我打开它,它就加载splash,然后关闭。
我添加了显示终端的代码,我在几个论坛中进行了搜索,似乎没有一个解决方案适合我的问题

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
erhoui1w

erhoui1w1#

我把注意力集中在这条线上,设法解决了这个问题。
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.credentials.UNLOCK }
事实证明,这是一个依赖关系的问题,在某些情况下失败是,其他人否从API 28,我添加了链接,从那里我被引导
https://github.com/Crypho/cordova-plugin-secure-storage/issues/169#issuecomment-509734410

相关问题