capacitor-community / sqlite

⚡Capacitor plugin for native & electron SQLite databases.
MIT License
501 stars 120 forks source link

Plugin failed to register in Android 11 physical device #196

Closed zesu2154 closed 2 years ago

zesu2154 commented 2 years ago

I had been using the plugin and had been successful in building/running that on both simulator/real device.

However, this popup last night, while the app runs on emulator and also on a real Android 10 device.

I used Android Studio and captured the run log, it seems that there is an exception when Capacitor register the sqlite plugin, please see below for the relavant log entries.

=========================================

D/Capacitor: Registering plugin: CapacitorSQLite W/AndroidKeystoreAesGcm: encountered a potentially transient KeyStore error, will wait and retry javax.crypto.AEADBadTagException at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517) at javax.crypto.Cipher.doFinal(Cipher.java:2113) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:97) at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206) at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238) at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155) at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53) at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34) at com.getcapacitor.PluginHandle.load(PluginHandle.java:95) at com.getcapacitor.PluginHandle.(PluginHandle.java:59) at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503) at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458) at com.getcapacitor.Bridge.(Bridge.java:188) at com.getcapacitor.Bridge.(Bridge.java:65) at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281) at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72) at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1436) at android.app.Activity.performStart(Activity.java:8158) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3566) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:8061) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) Caused by: android.security.KeyStoreException: Signature/MAC verification failed at android.security.KeyStore.getKeyStoreException(KeyStore.java:1301) at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:176) at android.security.keystore.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:373) at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506) at javax.crypto.Cipher.doFinal(Cipher.java:2113)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:97)  at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206)  at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238)  at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155)  at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53)  at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34)  at com.getcapacitor.PluginHandle.load(PluginHandle.java:95)  at com.getcapacitor.PluginHandle.(PluginHandle.java:59)  at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503)  at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458)  at com.getcapacitor.Bridge.(Bridge.java:188)  at com.getcapacitor.Bridge.(Bridge.java:65)  at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281)  at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72)  at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110)  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1436)  at android.app.Activity.performStart(Activity.java:8158)  at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3566)  at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)  at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)  at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:236)  at android.app.ActivityThread.main(ActivityThread.java:8061)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)  W/AndroidKeysetManager: cannot decrypt keyset: javax.crypto.AEADBadTagException at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517) at javax.crypto.Cipher.doFinal(Cipher.java:2113) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:101) at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206) at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238) at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155) at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53) at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34) at com.getcapacitor.PluginHandle.load(PluginHandle.java:95) at com.getcapacitor.PluginHandle.(PluginHandle.java:59) at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503) at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458) at com.getcapacitor.Bridge.(Bridge.java:188) at com.getcapacitor.Bridge.(Bridge.java:65) at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281) at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72) at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1436) at android.app.Activity.performStart(Activity.java:8158) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3566) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:8061) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) Caused by: android.security.KeyStoreException: Signature/MAC verification failed at android.security.KeyStore.getKeyStoreException(KeyStore.java:1301) at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:176) at android.security.keystore.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:373) at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506) at javax.crypto.Cipher.doFinal(Cipher.java:2113)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:101)  at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206)  at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238)  at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155)  at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53)  at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34)  at com.getcapacitor.PluginHandle.load(PluginHandle.java:95)  at com.getcapacitor.PluginHandle.(PluginHandle.java:59)  at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503)  at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458)  at com.getcapacitor.Bridge.(Bridge.java:188)  at com.getcapacitor.Bridge.(Bridge.java:65)  at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281)  at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72)  at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110)  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1436)  at android.app.Activity.performStart(Activity.java:8158)  at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3566)  at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)  at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)  at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:236)  at android.app.ActivityThread.main(ActivityThread.java:8061)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)  E/com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin: CapacitorSQLitePlugin: Protocol message contained an invalid tag (zero).

=========================================

And I also attached an ionic info printout as well

Ionic:

Ionic CLI : 6.18.1 (/Users/XXX/.nvm/versions/node/v16.13.0/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 5.8.5 @angular-devkit/build-angular : 12.1.4 @angular-devkit/schematics : 12.2.13 @angular/cli : 12.1.4 @ionic/angular-toolkit : 4.0.0

Capacitor:

Capacitor CLI : 3.3.1 @capacitor/android : 3.3.1 @capacitor/core : 3.3.1 @capacitor/ios : 3.3.1

Utility:

cordova-res : not installed globally native-run : 1.5.0

System:

NodeJS : v16.13.0 (/Users/XXX/.nvm/versions/node/v16.13.0/bin/node) npm : 7.24.2 OS : macOS Big Sur

=========================================

Not sure what's gone wrong, the only thing that I can think of is there may be an update to the capacitor. I believe I had tried to set all the capacitor version to 3.2.5, and if I remember correctly, the same error still persists.

Regards

jepiqueau commented 2 years ago

@zesu2154 Can you try deleting the android folder from your app and do npx cap add android npm run build npx cap copy and npx cap open android i assume you are using database encryption and that you have set the secret? if it still does not work can you share your app or a small repro app of the issue so i could have a look. I never got that error.

jepiqueau commented 2 years ago

@zesu2154 Any progress from your side ?

zesu2154 commented 2 years ago

@jepiqueau Sorry, I am on a business trip and away from my usual development machine, will have to get to it when I get back to office next Tuesday. My apology for the delay.

jepiqueau commented 2 years ago

@zesu2154 👍

marcocrotti69 commented 2 years ago

I have the same problem. Try to delete android folder and recreate but without success. Seems to be a problem with security.

============================== 2021-11-24 09:06:51.445 4971-4971/it.filcronet.wasteassociator D/Capacitor: Registering plugin: WebView 2021-11-24 09:06:51.460 4971-4971/it.filcronet.wasteassociator D/Capacitor: Registering plugin: BarcodeScanner 2021-11-24 09:06:51.471 4971-4971/it.filcronet.wasteassociator D/Capacitor: Registering plugin: CapacitorSQLite 2021-11-24 09:06:51.944 4971-4971/it.filcronet.wasteassociator W/AndroidKeystoreAesGcm: encountered a potentially transient KeyStore error, will wait and retry javax.crypto.AEADBadTagException at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517) at javax.crypto.Cipher.doFinal(Cipher.java:2113) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:97) at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206) at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238) at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155) at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53) at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34) at com.getcapacitor.PluginHandle.load(PluginHandle.java:95) at com.getcapacitor.PluginHandle.(PluginHandle.java:59) at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503) at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458) at com.getcapacitor.Bridge.(Bridge.java:188) at com.getcapacitor.Bridge.(Bridge.java:65) at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281) at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72) at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1419) at android.app.Activity.performStart(Activity.java:7479) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3454) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987) Caused by: android.security.KeyStoreException: Signature/MAC verification failed at android.security.KeyStore.getKeyStoreException(KeyStore.java:862) at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:224) at android.security.keystore.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:386) at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506) at javax.crypto.Cipher.doFinal(Cipher.java:2113)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:97)  at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206)  at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238)  at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155)  at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53)  at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34)  at com.getcapacitor.PluginHandle.load(PluginHandle.java:95)  at com.getcapacitor.PluginHandle.(PluginHandle.java:59)  at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503)  at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458)  at com.getcapacitor.Bridge.(Bridge.java:188)  at com.getcapacitor.Bridge.(Bridge.java:65)  at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281)  at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72)  at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110)  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1419)  at android.app.Activity.performStart(Activity.java:7479)  at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3454)  at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)  at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)  at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)  at android.os.Handler.dispatchMessage(Handler.java:112)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7625)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)  2021-11-24 09:06:52.069 4971-4971/it.filcronet.wasteassociator W/AndroidKeysetManager: cannot decrypt keyset: javax.crypto.AEADBadTagException at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517) at javax.crypto.Cipher.doFinal(Cipher.java:2113) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:101) at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206) at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238) at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155) at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53) at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34) at com.getcapacitor.PluginHandle.load(PluginHandle.java:95) at com.getcapacitor.PluginHandle.(PluginHandle.java:59) at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503) at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458) at com.getcapacitor.Bridge.(Bridge.java:188) at com.getcapacitor.Bridge.(Bridge.java:65) at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281) at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72) at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1419) at android.app.Activity.performStart(Activity.java:7479) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3454) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987) Caused by: android.security.KeyStoreException: Signature/MAC verification failed at android.security.KeyStore.getKeyStoreException(KeyStore.java:862) at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:224) at android.security.keystore.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:386) at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506) at javax.crypto.Cipher.doFinal(Cipher.java:2113)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:101)  at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206)  at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238)  at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155)  at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53)  at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34)  at com.getcapacitor.PluginHandle.load(PluginHandle.java:95)  at com.getcapacitor.PluginHandle.(PluginHandle.java:59)  at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503)  at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458)  at com.getcapacitor.Bridge.(Bridge.java:188)  at com.getcapacitor.Bridge.(Bridge.java:65)  at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281)  at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72)  at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110)  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1419)  at android.app.Activity.performStart(Activity.java:7479)  at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3454)  at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)  at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)  at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)  at android.os.Handler.dispatchMessage(Handler.java:112)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7625)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)  2021-11-24 09:06:52.074 4971-4971/it.filcronet.wasteassociator E/com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin: CapacitorSQLitePlugin: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.

============================================

I spent a lot of time but any solution found. Can Help us

jepiqueau commented 2 years ago

@marcocrotti69 Can you share your app on github

marcocrotti69 commented 2 years ago

Download it a this link https://www.dropbox.com/s/5cfphtbjf6jrqub/wasteAssociator.zip?dl=0. Thanks for you interest.

jepiqueau commented 2 years ago

@zesu2154 @marcocrotti69 thanks for providing your example it help to shows the issue and fixes it. this is done in release 3.3.1 Please do the following

npm i --save @capacitor/core@3.3.1   
npm i --save @capacitor/android@3.3.1   
npm i --save-dev @capacitor/cli@3.3.1   
npm i --save @capacitor-community/sqlite@3.3.1   

which put everything at the same level and then

npx cap sync
npm run build
npx cap copy
npx cap open android

Please close the issue if it works for you. Thanks again

marcocrotti69 commented 2 years ago

Tried your solution without luck.

============================================== 2021-11-25 10:10:49.826 19270-19270/it.filcronet.wasteassociator D/Capacitor: Starting BridgeActivity 2021-11-25 10:10:49.874 19270-19270/it.filcronet.wasteassociator D/Capacitor: Registering plugin: WebView 2021-11-25 10:10:49.888 19270-19270/it.filcronet.wasteassociator D/Capacitor: Registering plugin: CapacitorSQLite 2021-11-25 10:10:50.252 19270-19270/it.filcronet.wasteassociator W/AndroidKeystoreAesGcm: encountered a potentially transient KeyStore error, will wait and retry javax.crypto.AEADBadTagException at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517) at javax.crypto.Cipher.doFinal(Cipher.java:2113) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:97) at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206) at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238) at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155) at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:120) at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53) at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34) at com.getcapacitor.PluginHandle.load(PluginHandle.java:95) at com.getcapacitor.PluginHandle.(PluginHandle.java:59) at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503) at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458) at com.getcapacitor.Bridge.(Bridge.java:188) at com.getcapacitor.Bridge.(Bridge.java:65) at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281) at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72) at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:58) at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:41) at it.filcronet.wasteassociator.MainActivity.onCreate(MainActivity.java:19) at android.app.Activity.performCreate(Activity.java:7458) at android.app.Activity.performCreate(Activity.java:7448) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987) Caused by: android.security.KeyStoreException: Signature/MAC verification failed at android.security.KeyStore.getKeyStoreException(KeyStore.java:862) at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:224) at android.security.keystore.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:386) at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506) at javax.crypto.Cipher.doFinal(Cipher.java:2113)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:97)  at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206)  at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238)  at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155)  at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:120)  at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53)  at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34)  at com.getcapacitor.PluginHandle.load(PluginHandle.java:95)  at com.getcapacitor.PluginHandle.(PluginHandle.java:59)  at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503)  at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458)  at com.getcapacitor.Bridge.(Bridge.java:188)  at com.getcapacitor.Bridge.(Bridge.java:65)  at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281)  at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72)  at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:58)  at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:41)  at it.filcronet.wasteassociator.MainActivity.onCreate(MainActivity.java:19)  at android.app.Activity.performCreate(Activity.java:7458)  at android.app.Activity.performCreate(Activity.java:7448)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)  at android.os.Handler.dispatchMessage(Handler.java:112)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7625)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)  2021-11-25 10:10:50.351 19270-19270/it.filcronet.wasteassociator W/AndroidKeysetManager: cannot decrypt keyset: javax.crypto.AEADBadTagException at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517) at javax.crypto.Cipher.doFinal(Cipher.java:2113) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115) at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:101) at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206) at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287) at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238) at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155) at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:120) at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53) at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34) at com.getcapacitor.PluginHandle.load(PluginHandle.java:95) at com.getcapacitor.PluginHandle.(PluginHandle.java:59) at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503) at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458) at com.getcapacitor.Bridge.(Bridge.java:188) at com.getcapacitor.Bridge.(Bridge.java:65) at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281) at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72) at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:58) at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:41) at it.filcronet.wasteassociator.MainActivity.onCreate(MainActivity.java:19) at android.app.Activity.performCreate(Activity.java:7458) at android.app.Activity.performCreate(Activity.java:7448) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199) at android.os.Handler.dispatchMessage(Handler.java:112) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987) Caused by: android.security.KeyStoreException: Signature/MAC verification failed at android.security.KeyStore.getKeyStoreException(KeyStore.java:862) at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:224) at android.security.keystore.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:386) at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506) at javax.crypto.Cipher.doFinal(Cipher.java:2113)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:115)  at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:101)  at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:206)  at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:107)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:311)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:287)  at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:238)  at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:155)  at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:120)  at com.getcapacitor.community.database.sqlite.CapacitorSQLite.(CapacitorSQLite.java:53)  at com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin.load(CapacitorSQLitePlugin.java:34)  at com.getcapacitor.PluginHandle.load(PluginHandle.java:95)  at com.getcapacitor.PluginHandle.(PluginHandle.java:59)  at com.getcapacitor.Bridge.registerPlugin(Bridge.java:503)  at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:458)  at com.getcapacitor.Bridge.(Bridge.java:188)  at com.getcapacitor.Bridge.(Bridge.java:65)  at com.getcapacitor.Bridge$Builder.create(Bridge.java:1281)  at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72)  at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:58)  at com.getcapacitor.BridgeActivity.init(BridgeActivity.java:41)  at it.filcronet.wasteassociator.MainActivity.onCreate(MainActivity.java:19)  at android.app.Activity.performCreate(Activity.java:7458)  at android.app.Activity.performCreate(Activity.java:7448)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)  at android.os.Handler.dispatchMessage(Handler.java:112)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7625)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)  2021-11-25 10:10:50.357 19270-19270/it.filcronet.wasteassociator E/com.getcapacitor.community.database.sqlite.CapacitorSQLitePlugin: CapacitorSQLitePlugin: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length. 2021-11-25 10:10:50.364 19270-19270/it.filcronet.wasteassociator D/Capacitor: Registering plugin: Geolocation 2021-11-25 10:10:50.379 19270-19270/it.filcronet.wasteassociator D/Capacitor: Registering plugin: BarcodeScanner 2021-11-25 10:10:50.442 19270-19270/it.filcronet.wasteassociator E/Capacitor: Unable to read file at path public/plugins 2021-11-25 10:10:50.446 19270-19270/it.filcronet.wasteassociator D/Capacitor: Loading app at http://localhost 2021-11-25 10:10:50.536 19270-19270/it.filcronet.wasteassociator D/Capacitor: App started 2021-11-25 10:10:50.549 19270-19270/it.filcronet.wasteassociator D/Capacitor: App resumed 2021-11-25 10:10:50.639 19270-19372/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/ 2021-11-25 10:10:51.174 19270-19372/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/styles.css 2021-11-25 10:10:51.175 19270-19369/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/runtime.js 2021-11-25 10:10:51.216 19270-19369/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/polyfills.js 2021-11-25 10:10:51.216 19270-19372/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/vendor.js 2021-11-25 10:10:51.217 19270-19368/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/main.js 2021-11-25 10:10:52.427 19270-19368/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_jeep-sqlite_dist_esm_jeep-sqlite_entry_js.js 2021-11-25 10:10:52.488 19270-19270/it.filcronet.wasteassociator I/Capacitor/Console: File: http://localhost/vendor.js - Line 70310 - Msg: Angular is running in development mode. Call enableProdMode() to enable production mode. 2021-11-25 10:10:52.500 19270-19368/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/common.js 2021-11-25 10:10:52.503 19270-19372/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-app_8_entry_js.js 2021-11-25 10:10:52.516 19270-19368/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/src_app_tabs_tabs_module_ts.js 2021-11-25 10:10:52.518 19270-19270/it.filcronet.wasteassociator I/Capacitor/Console: File: http://localhost/main.js - Line 104 - Msg: plaform android 2021-11-25 10:10:52.519 19270-19270/it.filcronet.wasteassociator I/Capacitor/Console: File: http://localhost/main.js - Line 142 - Msg: >>>> in App this.initPlugin true 2021-11-25 10:10:52.594 19270-19372/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/src_app_tab1_tab1_module_ts.js 2021-11-25 10:10:52.618 19270-19372/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_swipe-back-fae97365_js.js 2021-11-25 10:10:52.717 19270-19270/it.filcronet.wasteassociator I/Capacitor/Console: File: http://localhost/node_modules_jeep-sqlite_dist_esm_jeep-sqlite_entry_js.js - Line 8319 - Msg: >>> jeep-sqlite StoreName: jeepSqliteStore 2021-11-25 10:10:53.073 19270-19372/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/src_app_tab2_tab2_module_ts.js 2021-11-25 10:10:53.073 19270-19368/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/src_app_tab3_tab3_module_ts.js 2021-11-25 10:10:53.087 19270-19372/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-tab-bar_2_entry_js.js 2021-11-25 10:10:53.089 19270-19368/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-button_2_entry_js.js 2021-11-25 10:10:53.089 19270-19369/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-item_8_entry_js.js 2021-11-25 10:10:53.107 19270-19369/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-card_5_entry_js.js 2021-11-25 10:10:53.108 19270-19379/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-select_3_entry_js.js 2021-11-25 10:10:53.121 19270-19463/it.filcronet.wasteassociator V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 53811159, pluginId: CapacitorSQLite, methodName: isDatabase 2021-11-25 10:10:53.122 19270-19463/it.filcronet.wasteassociator V/Capacitor: callback: 53811159, pluginId: CapacitorSQLite, methodName: isDatabase, methodData: {"database":"wasteAssociator"} 2021-11-25 10:10:53.123 19270-19396/it.filcronet.wasteassociator V/com.getcapacitor.community.database.sqlite.RetHandler: *** ERROR isDatabase: Attempt to invoke virtual method 'java.lang.Boolean com.getcapacitor.community.database.sqlite.CapacitorSQLite.isDatabase(java.lang.String)' on a null object reference 2021-11-25 10:10:53.125 19270-19396/it.filcronet.wasteassociator D/Capacitor: Sending plugin error: {"save":false,"callbackId":"53811159","pluginId":"CapacitorSQLite","methodName":"isDatabase","success":false,"error":{"message":"isDatabase: Attempt to invoke virtual method 'java.lang.Boolean com.getcapacitor.community.database.sqlite.CapacitorSQLite.isDatabase(java.lang.String)' on a null object reference"}} 2021-11-25 10:10:53.173 19270-19270/it.filcronet.wasteassociator E/Capacitor/Console: File: http://localhost/polyfills.js - Line 4247 - Msg: Unhandled Promise rejection: isDatabase: Attempt to invoke virtual method 'java.lang.Boolean com.getcapacitor.community.database.sqlite.CapacitorSQLite.isDatabase(java.lang.String)' on a null object reference ; Zone: ; Task: null ; Value: Error: isDatabase: Attempt to invoke virtual method 'java.lang.Boolean com.getcapacitor.community.database.sqlite.CapacitorSQLite.isDatabase(java.lang.String)' on a null object reference Error: isDatabase: Attempt to invoke virtual method 'java.lang.Boolean com.getcapacitor.community.database.sqlite.CapacitorSQLite.isDatabase(java.lang.String)' on a null object reference at Object.cap.fromNative (http://localhost/:414:32) at :1:18 2021-11-25 10:10:53.180 19270-19270/it.filcronet.wasteassociator E/Capacitor/Console: File: http://localhost/vendor.js - Line 48717 - Msg: ERROR Error: Uncaught (in promise): Error: Error: isDatabase: Attempt to invoke virtual method 'java.lang.Boolean com.getcapacitor.community.database.sqlite.CapacitorSQLite.isDatabase(java.lang.String)' on a null object reference Error: Error: isDatabase: Attempt to invoke virtual method 'java.lang.Boolean com.getcapacitor.community.database.sqlite.CapacitorSQLite.isDatabase(java.lang.String)' on a null object reference at SQLiteService. (http://localhost/main.js:561:43) at Generator.throw () at rejected (http://localhost/vendor.js:365:65) at ZoneDelegate.invoke (http://localhost/polyfills.js:3545:30) at Object.onInvoke (http://localhost/vendor.js:70943:33) at ZoneDelegate.invoke (http://localhost/polyfills.js:3544:56) at Zone.run (http://localhost/polyfills.js:3305:47) at http://localhost/polyfills.js:4463:38 at ZoneDelegate.invokeTask (http://localhost/polyfills.js:3579:35) at Object.onInvokeTask (http://localhost/vendor.js:70930:33) 2021-11-25 10:10:53.353 19270-19379/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/svg/triangle.svg 2021-11-25 10:10:53.353 19270-19368/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/svg/ellipse.svg 2021-11-25 10:10:53.356 19270-19369/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/svg/square.svg 2021-11-25 10:10:53.373 19270-19369/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-ripple-effect_entry_js.js 2021-11-25 10:10:53.533 19270-19369/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/assets/icon/favicon.png 2021-11-25 10:10:53.564 19270-19369/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_tap-click-cc1ae2b2_js.js 2021-11-25 10:10:53.568 19270-19379/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_keyboard-5742b5da_js.js 2021-11-25 10:10:53.568 19270-19368/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_status-tap-5c3a5bca_js.js 2021-11-25 10:10:53.571 19270-19372/it.filcronet.wasteassociator D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_focus-visible-f4ad4f1a_js.js 2021-11-25 10:11:00.470 19270-19270/it.filcronet.wasteassociator D/Capacitor: App paused 2021-11-25 10:11:00.538 19270-19270/it.filcronet.wasteassociator D/Capacitor: App stopped 2021-11-25 10:11:00.551 19270-19270/it.filcronet.wasteassociator D/Capacitor: Saving instance state!

===========================================================

This is my package,json: { "name": "wasteAssociator", "version": "0.0.1", "author": "Ionic Framework", "homepage": "https://ionicframework.com/", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/common": "~12.1.1", "@angular/core": "~12.1.1", "@angular/forms": "~12.1.1", "@angular/platform-browser": "~12.1.1", "@angular/platform-browser-dynamic": "~12.1.1", "@angular/router": "~12.1.1", "@capacitor-community/barcode-scanner": "^2.0.1", "@capacitor-community/sqlite": "^3.3.1", "@capacitor/android": "^3.3.1", "@capacitor/app": "^1.0.6", "@capacitor/core": "^3.3.1", "@capacitor/geolocation": "^1.2.0", "@capacitor/haptics": "^1.1.3", "@capacitor/keyboard": "^1.1.3", "@capacitor/status-bar": "^1.0.6", "@capacitor/storage": "^1.2.3", "@ionic/angular": "^5.8.5", "jeep-sqlite": "^1.3.2", "rxjs": "~6.6.0", "tslib": "^2.2.0", "zone.js": "~0.11.4" }, "devDependencies": { "@angular-devkit/build-angular": "~12.1.1", "@angular-eslint/builder": "~12.0.0", "@angular-eslint/eslint-plugin": "~12.0.0", "@angular-eslint/eslint-plugin-template": "~12.0.0", "@angular-eslint/template-parser": "~12.0.0", "@angular/cli": "~12.1.1", "@angular/compiler": "~12.1.1", "@angular/compiler-cli": "~12.1.1", "@angular/language-service": "~12.0.1", "@capacitor/cli": "^3.3.1", "@ionic/angular-toolkit": "^4.0.0", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "@typescript-eslint/eslint-plugin": "4.16.1", "@typescript-eslint/parser": "4.16.1", "eslint": "^7.6.0", "eslint-plugin-import": "2.22.1", "eslint-plugin-jsdoc": "30.7.6", "eslint-plugin-prefer-arrow": "1.2.2", "jasmine-core": "~3.8.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~6.3.2", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.0.3", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "~7.0.0", "ts-node": "~8.3.0", "typescript": "~4.2.4" }, "description": "An Ionic project" }


I have also deleted all folder (www, andoird, node_modules) and regenerate all resources but won't work.

Thacks

marcocrotti69 commented 2 years ago

I have used this trick. Changing the package name i resolved the error. I think that: the phone register some information (i don't know where) and also if i remove the app that information aren't cleared. For the moment the app it's ok. Thanks a lot.

jepiqueau commented 2 years ago

@marcocrotti69 I do not really understand what is going on. i download your app, install it, build it and when running it getting the same error, then i delete the app from the physical device and made the modifications, remove the android folder and then did exactly what i mentioned earlier and it works fine. i test it on API21 device. i will close the issue

zesu2154 commented 2 years ago

Sorry for being late in getting back here.

I cannot reproduce using a small sample app. It runs without problem.

@marcocrotti69 So you just change the package name from something like com.example.app to com.example.app2, and everything is ok??

And the weird thing is it works fine with Android 11 simulator, Android 10 real device, various ios devices. Just failed with Android 11 real devices.

scs2771 commented 2 years ago

I am have a similar issue. I am getting an error of "Msg: Uncaught (in promise) Error: isDatabase: Attempt to invoke virtual method" on my device but not the simulator. To fix it I have to drop the android folder and change the appId in the capacitor.config.ts file.

The problem with this is now I can't use the original appID. If repeat the process with the original appId the error comes back on my device.

**Update After looking into possible issues with caching of android studio and Gradle, I decided to revert the appId back to the original id. After restarting android studio everything looks to working properly and no more error messages.

gregorgretz commented 2 years ago

I was fighting with exact the same problem for some days. The problems occurred on two different Android devices (Android 8.1 and Android 12) after several app updates and for two different users. Our app is also running on iOS, but there we don't have any problems. We are using:

Even after an uninstall and reinstall, the plugin throws the mentioned error (W/AndroidKeystoreAesGcm: encountered a potentially....).

Today I found out that this is caused by the automatic backups of app data via android. I could (partially) solve the problem by disabling backups in AndroidManifest with: android:allowBackup="false" and then after I uninstalled and reinstalled the new version, the problem was gone! Maybe this helps someone too.

Priyansu431 commented 2 years ago

Thanks, It's worked for me... :)

eshernandez commented 2 years ago

Thanks, It's worked for me... :)**** x2

I had too that error