dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.09k stars 1.73k forks source link

Android app throwing Exception_WasThrown Java.Security.GeneralSecurityException #23106

Closed ganikapudisham closed 4 months ago

ganikapudisham commented 4 months ago

Description

I see the below error

Android app throwing Exception_WasThrown Java.Security.GeneralSecurityException

when I try to Sign In.

The website https://www.ChristianJodi.com uses the same api's . I am able to login to the website using the below credentials.

Steps to Reproduce

Run the app.

Username is Prince Password is Prince

try to login

Link to public reproduction project repository

https://github.com/ganikapudisham/maui-matri

Version with bug

Unknown/Other

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

logisnextsteve commented 4 months ago

Good morning ganikapudisham,

What did you do to fix this issue? We're running into it now...

mistelltein commented 3 months ago

I'm also want to know how to fix this

mistelltein commented 3 months ago

The issue was likely with SecureStorage. This problem appeared recently, although the code hasn't changed significantly.

Following the suggestions, I added these lines to the csproj:

<PropertyGroup Condition="$(Configuration)=='Release'">
    <RunAOTCompilation>false</RunAOTCompilation>
    <PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>

Afterwards, during authentication, I encountered the: "javax.crypto.AEADBadTagException" error, which I resolved by disabling backups in the manifest:

<application android:allowBackup="false" ... >

These solutions helped fix the issues in the release application.