Starts in:
1 DAY
22 HRS
30 MIN
24 SEC
Starts in:
1 D
22 H
30 M
24 S
Open Closed

Mobile MAUI Android Release build stuck on splash #6409


User avatar
0
464199480 created
  • ABP Framework version: v8.0.0
  • UI type: Angular + MAUI mobile
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: no exception only stuck on splash screen when build Android in Release mode, no issue on

I have tried to disable AOT, Trimming, repair/restore/update workloads

same question: https://support.abp.io/QA/Questions/6137/Mobile-MAUI-Android-Release-build-stuck-on-splash It is still unresolved

The solution doesn't work https://github.com/abpio/abp-commercial-docs/pull/592


5 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    I have reproduced the problem and it occurs because of SecureStorage. We have used in exactly same way with the MAUI documentation but it doesn't respond at runtime in release mod only on Android. It seems it's related to MAUI implementation.

    You can use Preferences API or use a simple Sqlite to keep data in the DefaultStorage implementation as a workaround. We aware the problem but we don't have a solution for android yet

  • User Avatar
    0
    464199480 created

    I've done some experiments that I hope will help.

    1. Create a Hello World solution for maui
    2. Trigger SecureStorage by clicking a button

    This is not working code

    private void OnCounterClicked(object sender, EventArgs e)
    {
        count++;
    
        if (count == 1)
            CounterBtn.Text = $"Clicked {count} time";
        else
            CounterBtn.Text = $"Clicked {count} times";
    
        SecureStorage.Default.SetAsync("__access_token", CounterBtn.Text).GetAwaiter();
    
        var values = SecureStorage.Default.GetAsync("__access_token").GetAwaiter().GetResult()!;
    
        SemanticScreenReader.Announce(values);
    }
    

    This is working code

    private async void OnCounterClicked(object sender, EventArgs e)
    {
        count++;
    
        if (count == 1)
            CounterBtn.Text = $"Clicked {count} time";
        else
            CounterBtn.Text = $"Clicked {count} times";
    
        await SecureStorage.Default.SetAsync("__access_token", CounterBtn.Text);
    
        var values = await SecureStorage.Default.GetAsync("__access_token");
    
        SemanticScreenReader.Announce(values);
    }
    

    I think the relationship between void OnCounterClicked and async void OnCounterClicked is async

  • User Avatar
    0
    464199480 created

    Delete MauiCurrentPrincipalAccessor GetClaimsPrincipal method returns read SecureStorage code, it works

  • User Avatar
    0
    464199480 created

    I think CurrentPrincipalAccessorBase increase async can be solved, like this

    protected abstract Task<ClaimsPrincipal> GetClaimsPrincipal();

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Thanks for your findings, We'll update the template according to this information, thanks for this key point

    Also, your credit is refunded

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06