Skip to content

Failed to delete entry: CognitoIdentityProviderCache.aesKeyStoreAlias #2891

Closed
@LevGloba

Description

@LevGloba

Before opening, please confirm:

Language and Async Model

Kotlin - Coroutines

Amplify Categories

Authentication

Gradle script dependencies

implementation "com.amplifyframework:aws-api:2.20.0" implementation "com.amplifyframework:aws-datastore:2.20.0" implementation "com.amplifyframework:aws-auth-cognito:2.20.0" implementation "com.amplifyframework:core-kotlin:2.20.0" implementation "com.amplifyframework:core:2.20.0" implementation "com.amplifyframework:aws-storage-s3:2.20.0"

Environment information

Gradle Version 8.7

Please include any relevant guides or documentation you're referencing

No response

Describe the bug

Failed to delete entry: CognitoIdentityProviderCache.aesKeyStoreAlias.
There was a bug once
Phone model Huawei Y5 2018, Android version 8.1.0

Reproduction steps (if applicable)

In the App class, inherited from Application, call methods:
1.Amplify.addPlugin(AWSCognitoAuthPlugin());
2.Amplify.addPlugin(AWSS3StoragePlugin());
3.Amplify.configure(
AmplifyConfiguration.fromConfigFile(
applicationContext,
R.raw.amplifyconfiguration
), applicationContext
)

Code Snippet

@HiltAndroidApp
class App : Application() {

    override fun onCreate() {
        super.onCreate()
        initAmplify()
       ...
    }
...
    private fun initAmplify() {
        Amplify.addPlugin(AWSCognitoAuthPlugin())
        Amplify.addPlugin(AWSS3StoragePlugin())
        Amplify.configure(
            AmplifyConfiguration.fromConfigFile(
                applicationContext,
                R.raw.amplifyconfiguration
            ), applicationContext
        )
    }
}

Log output

      Fatal Exception: java.security.KeyStoreException: Failed to delete entry: CognitoIdentityProviderCache.aesKeyStoreAlias
   at android.security.keystore.AndroidKeyStoreSpi.engineDeleteEntry(AndroidKeyStoreSpi.java:778)
   at java.security.KeyStore.deleteEntry(KeyStore.java:1257)
   at com.amplifyframework.auth.cognito.data.LegacyKeyProvider.deleteKey(LegacyKeyProvider.kt:82)
   at com.amplifyframework.auth.cognito.data.LegacyKeyValueRepository.retrieveEncryptionKey-IoAF18A(LegacyKeyValueRepository.kt:271)
   at com.amplifyframework.auth.cognito.data.LegacyKeyValueRepository.get(LegacyKeyValueRepository.kt:161)
   at com.amplifyframework.auth.cognito.data.AWSCognitoLegacyCredentialStore.getTokenKeys(AWSCognitoLegacyCredentialStore.kt:272)
   at com.amplifyframework.auth.cognito.data.AWSCognitoLegacyCredentialStore.retrieveSignedInData(AWSCognitoLegacyCredentialStore.kt:207)
   at com.amplifyframework.auth.cognito.data.AWSCognitoLegacyCredentialStore.retrieveCredential(AWSCognitoLegacyCredentialStore.kt:105)
   at com.amplifyframework.auth.cognito.actions.CredentialStoreCognitoActions$migrateLegacyCredentialStoreAction$$inlined$invoke$1.execute(Action.kt:69)
   at com.amplifyframework.statemachine.ConcurrentEffectExecutor$execute$1$1.invokeSuspend(ConcurrentEffectExecutor.kt:26)
   at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
   at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
   at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    authRelated to the Auth category/pluginsbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions