Flutter SDK - Android - sharedPreferences has not been initialized

Hi :slight_smile:

We are getting the following errors on android using the Flutter SDK:

W/System.err( 7319): kotlin.UninitializedPropertyAccessException: lateinit property sharedPreferences has not been initialized
W/System.err( 7319): 	at com.web3auth.core.keystore.KeyStoreManagerUtils.decryptData(KeyStoreManagerUtils.kt:85)
W/System.err( 7319): 	at com.web3auth.core.Web3Auth.login(Web3Auth.kt:138)
W/System.err( 7319): 	at com.web3auth.flutter.web3auth_flutter.Web3AuthFlutterPlugin.runMethodCall(Web3AuthFlutterPlugin.kt:115)
W/System.err( 7319): 	at com.web3auth.flutter.web3auth_flutter.Web3AuthFlutterPlugin.access$runMethodCall(Web3AuthFlutterPlugin.kt:30)
W/System.err( 7319): 	at com.web3auth.flutter.web3auth_flutter.Web3AuthFlutterPlugin$onMethodCall$1.invokeSuspend(Web3AuthFlutterPlugin.kt:76)
W/System.err( 7319): 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
W/System.err( 7319): 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
W/System.err( 7319): 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
W/System.err( 7319): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
W/System.err( 7319): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
W/System.err( 7319): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
  • SDK Version: 2.0.0

Please let me know if this is a known issue and what can be done to address it.

Hey @shareef

Are you running our example app? or working with a new one?

Also, import 'package:shared_preferences/shared_preferences.dart'; is not a dependency of our Flutter SDK but it works well with our SDK, which can be seen in our examples.

Hi @shahbaz. We are running out own app. We use shared_preferences in our own app, but the logs seem to be coming from com.web3auth.core.

Hey @shareef

Let me share this with the Mobile team. I will keep you posted on the updates here.

1 Like

hello, this issue is known to be resolved in version 2.0.3.
Please update your sdk version and then try again.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.