opensrp / fhircore

FHIR Core / OpenSRP 2 is a Kotlin application for delivering offline-capable, mobile-first healthcare project implementations from local community to national and international scale using FHIR and WHO Smart Guidelines on Android.
https://opensrp.io
Apache License 2.0
59 stars 59 forks source link

App force closes on launch after install. Clearing Data is a workaround #3492

Closed dubdabasoduba closed 2 months ago

dubdabasoduba commented 2 months ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

Additional context

dubdabasoduba commented 2 months ago
2024-08-26 17:08:46.517 17577-17577 AndroidRuntime          org.smartregister.opensrp.eusm       D  Shutting down VM
2024-08-26 17:08:46.518 17577-17577 AndroidRuntime          org.smartregister.opensrp.eusm       E  FATAL EXCEPTION: main
                                                                                                    Process: org.smartregister.opensrp.eusm, PID: 17577
                                                                                                    java.lang.RuntimeException: Unable to create application org.smartregister.fhircore.quest.QuestApplication: javax.crypto.AEADBadTagException
                                                                                                        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7716)
                                                                                                        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2478)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:230)
                                                                                                        at android.os.Looper.loop(Looper.java:319)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8919)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
                                                                                                    Caused by: javax.crypto.AEADBadTagException
                                                                                                        at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:632)
                                                                                                        at javax.crypto.Cipher.doFinal(Cipher.java:2114)
                                                                                                        at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decryptInternal(AndroidKeystoreAesGcm.java:118)
                                                                                                        at com.google.crypto.tink.integration.android.AndroidKeystoreAesGcm.decrypt(AndroidKeystoreAesGcm.java:101)
                                                                                                        at com.google.crypto.tink.KeysetHandle.decrypt(KeysetHandle.java:919)
                                                                                                        at com.google.crypto.tink.KeysetHandle.readWithAssociatedData(KeysetHandle.java:804)
                                                                                                        at com.google.crypto.tink.KeysetHandle.read(KeysetHandle.java:785)
                                                                                                        at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readMasterkeyDecryptAndParseKeyset(AndroidKeysetManager.java:381)
                                                                                                        at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:297)
                                                                                                        at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:169)
                                                                                                        at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:130)
                                                                                                        at org.smartregister.fhircore.engine.util.SecureSharedPreference.<init>(SecureSharedPreference.kt:36)
                                                                                                        at org.smartregister.fhircore.quest.DaggerQuestApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get(DaggerQuestApplication_HiltComponents_SingletonC.java:1389)
                                                                                                        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
                                                                                                        at org.smartregister.fhircore.quest.DaggerQuestApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get(DaggerQuestApplication_HiltComponents_SingletonC.java:1386)
                                                                                                        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
                                                                                                        at org.smartregister.fhircore.quest.DaggerQuestApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get(DaggerQuestApplication_HiltComponents_SingletonC.java:1383)
                                                                                                        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
                                                                                                        at org.smartregister.fhircore.quest.DaggerQuestApplication_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get(DaggerQuestApplication_HiltComponents_SingletonC.java:1516)
                                                                                                        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
                                                                                                        at org.smartregister.fhircore.quest.DaggerQuestApplication_HiltComponents_SingletonC$SingletonCImpl.injectQuestApplication2(DaggerQuestApplication_HiltComponents_SingletonC.java:1346)
                                                                                                        at org.smartregister.fhircore.quest.DaggerQuestApplication_HiltComponents_SingletonC$SingletonCImpl.injectQuestApplication(DaggerQuestApplication_HiltComponents_SingletonC.java:1335)
                                                                                                        at org.smartregister.fhircore.quest.Hilt_QuestApplication.hiltInternalInject(Hilt_QuestApplication.java:52)
                                                                                                        at org.smartregister.fhircore.quest.Hilt_QuestApplication.onCreate(Hilt_QuestApplication.java:43)
                                                                                                        at org.smartregister.fhircore.quest.QuestApplication.onCreate(QuestApplication.kt:59)
                                                                                                        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316)
                                                                                                        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7711)
                                                                                                        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) 
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2478) 
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                        at android.os.Looper.loopOnce(Looper.java:230) 
                                                                                                        at android.os.Looper.loop(Looper.java:319) 
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8919) 
                                                                                                        at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) 
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) 
2024-08-26 17:08:46.519 17577-17577 AndroidRuntime          org.smartregister.opensrp.eusm       E  Caused by: android.security.KeyStoreException: Signature/MAC verification failed (internal Keystore code: -30 message: system/security/keystore2/src/operation.rs:850: KeystoreOperation::finish

                                                                                                    Caused by:
                                                                                                        0: system/security/keystore2/src/operation.rs:426: Finish failed.
                                                                                                        1: Error::Km(r#VERIFICATION_FAILED)) (public error code: 10 internal Keystore code: -30)
                                                                                                        at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:435)
                                                                                                        at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:78)
                                                                                                        at android.security.KeyStoreOperation.finish(KeyStoreOperation.java:128)
                                                                                                        at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.finish(KeyStoreCryptoOperationChunkedStreamer.java:228)
                                                                                                        at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:181)
                                                                                                        at android.security.keystore2.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:396)
                                                                                                        at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:624)
                                                                                                        ... 35 more
2024-08-26 17:08:46.548 17577-17577 Process                 org.smartregister.opensrp.eusm       I  Sending signal. PID: 17577 SIG: 9
---------------------------- PROCESS ENDED (17577) for package org.smartregister.opensrp.eusm ----------------------------