Error while using SecureStorage in MAUI application
See original GitHub issueDescription
Application crashes with the below error when using SecureStorage: System.IO.FileNotFoundException: ‘Could not load file or assembly ‘Xamarin.AndroidX.Security.SecurityCrypto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies.’
Steps to Reproduce
- Create a new project using template “.NET MAUI App (Preview)”
- Open MainPage.xaml.cs and add the following line to OnCounterClicked mehtod: string testValue = await SecureStorage.GetAsync(“Test”);
- Run application > Click on the “Click me” button. The application crashes with the exception: System.IO.FileNotFoundException: ‘Could not load file or assembly ‘Xamarin.AndroidX.Security.SecurityCrypto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies.’
Version with bug
Preview 11
Last version that worked well
Unknown/Other
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
Android 11
Did you find any workaround?
Add Xamarin.AndroidX.Security.SecurityCrypto (Version: 1.1.0-alpha03) NuGet package to project
Relevant log output
Resolved pending breakpoint at 'MainPage.xaml.cs:19,1' to void MauiTestApp.MainPage.<OnCounterClicked>d__2.MoveNext () [0x000e7].
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Security.SecurityCrypto.dll
**System.IO.FileNotFoundException:** 'Could not load file or assembly 'Xamarin.AndroidX.Security.SecurityCrypto, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.'
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Security.SecurityCrypto.dll
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Suddenly getting SecureStorage issues in MAUI
I use SecureStorage for storing API logins, and tokens. Have been using them for ages, but this has come up all of a...
Read more >SecureStorage not working in MAUI with android emulator
I'm new to MAUI and i want to save a token to the secureStorage. I have the following line to save the key...
Read more >SecureStorage deadlock when called from an DI class.
This code, when called from a maui project razor page with ICustomStorage dependency injected, causes deadlock/application hang.
Read more >How to use .Net MAUI Secure storage in your Mobile ...
The following steps are to create/get / Clear secure storage using.Net MAUI application. The .Net MAUI Secure Storage and ISecureStorage types ...
Read more >Add Authentication to .NET MAUI Apps with Auth0
Learn how to authenticate users of your .NET MAUI application using Auth0. Read more… :writing_hand:t2: Brought to you by @andrea.chiarelli.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I haven’t tested in iOS yet. I can live without the workaround for the moment until this bug is fixed
@rachelkang @Redth is bug https://github.com/dotnet/maui/issues/4490 related with this bug here?