Open Closed

Autofac error in new MAUI solution (Microservice and Tiered/Layered) #8192


User avatar
0
hvallad531 created

Trying to create a new Microservice solution to see if it fulfills our needs better and I cannot get the MAUI app to start. Error occurs when the AppShell executes the InitializeComponent method.

Used the following settings during the creation process:

  • ABP Framework version: v8.3.0

  • Solution Template: Microservice

  • Name: Test.Microservices

    • Dont use "local ABP framework"
  • DB Provider: Entity Framework Core

  • Database Type: SQL Server

  • UI Framework: Blazor Server

  • Mobile Framework: MAUI

  • Public Website: Yes

  • Optional Modules: Default

    • Audit Logging
    • GDPR
    • Language Management
    • OpenIddict UI
    • SaaS
    • Text Template Management
  • UI Themes: LeptonX

    • Style: System
  • No Additional Options

  • Exception message and full stack trace: 0xFFFFFFFFFFFFFFFF in Android.Runtime.RuntimeNativeMethods.monodroid_debugger_unhandled_exception C# 0x1A in Android.Runtime.JNINativeWrapper._unhandled_exception at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:12,5 C# 0x1D in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:23,26 C# 0x7A in Autofac.Core.Resolving.ResolveOperation.ExecuteOperation C# 0x2 in Autofac.Core.Resolving.ResolveOperation.Execute C# 0x2D in Autofac.Core.Lifetime.LifetimeScope.ResolveComponent C# 0x7 in Autofac.Core.Container.ResolveComponent C# 0x2 in Autofac.Core.Container.Autofac.IComponentContext.ResolveComponent C# 0x31 in Autofac.ResolutionExtensions.TryResolveService C# 0x35 in Autofac.ResolutionExtensions.ResolveOptionalService C# 0x8 in Autofac.ResolutionExtensions.ResolveOptional C# 0x7 in Autofac.ResolutionExtensions.ResolveOptional C# 0x7 in Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetService C# 0x2D in Microsoft.Maui.MauiContext.WrappedServiceProvider.GetService at D:\a_work\1\s\src\Core\src\MauiContext.cs:72,5 C# 0x2D in Microsoft.Maui.MauiContext.WrappedServiceProvider.GetService at D:\a_work\1\s\src\Core\src\MauiContext.cs:72,5 C# 0x2A in Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService C# 0x16 in Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<Microsoft.Maui.IApplication> C# 0x51 in Microsoft.Maui.MauiApplication.OnCreate at D:\a_work\1\s\src\Core\src\Platform\Android\MauiApplication.cs:46,4 C# 0x8 in Android.App.Application.n_OnCreate at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net8.0/android-34/mcw/Android.App.Application.cs:1087,4 C# 0x8 in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:22,5 C#

  • Steps to reproduce the issue:

  1. Create new microservice solution
  2. Setup configuration files to point at the correct databases
  3. Start Redis Server in WSL
  4. Start Services
  5. Start Gateways
  6. Start Apps (except MAUI)
  7. Launch MAUI app in Android
  8. Get exception

6 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    could you please share a test project with me? i will check it, thanks.

  • User Avatar
    0
    hvallad531 created

    Here it is, however its a blank tempate from ABP Studio, I havent changed anything yet other than the app settings. Only MAUI that I have issues.

    https://github.com/UniversalHVallad/WMS3_Microservices_Template

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Okay, i will check it.

    BTW, please make the repo private. I think you don't want to leak your license

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I can't reproduce the problem.

    My steps

    Change all HTTP to HTTPS

    Update MAUI appsettings.json

    Run all services and MAUI app

  • User Avatar
    0
    hvallad531 created

    I changed all my appsettings to use HTTPS and it was still not working. I did not change my MAUI app settings since I am using a physical device, so I left it pointed at my machine's IP. I also did not deploy to an IPhone, as we will be strictly using android devices.

    After some additional testing I figured out that I needed to use Ngrok to tunnel the https versions of my localhost addresses. Long story short, it wasnt able to reach my api/gateways to access the proxys. You weren't able to replicate the same issue I was having because you were using an emulator instead of a physical device.

    Now I need to find out why the side menu is permenantly open and we are off the landing pad...

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can try to use Android emulator to debug it.

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