Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FileNotFoundException when running on iOS with .NET 8 MAUI #136

@munkii

Description

@munkii

Using .NET8 MAUI version 8.0.91 and SimpleAuth 1.0.56-beta

After adding SimpleAuth to the MAUI project template I get the following error trying to instaniate FitBitApi when deploying to iOS. There is no issue when deploying to Android.

System.IO.FileNotFoundException: 'Could not load file or assembly 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' or one of its dependencies.'

Here is a link to a repro
https://github.com/munkii/SimpleAuthFileNotFoundRepro

Here is the call stack

0x0 in SimpleAuth.Providers.FitBitApi..ctor at C:\Projects\SimpleAuth\src\SimpleAuth\Providers\Google.cs:106,4 C#

0x1E in SimpleAuthFileNotFoundRepro.ViewModel.MainViewModel..ctor at C:\Users\longp\source\repos\SimpleAuthFileNotFoundRepro\SimpleAuthFileNotFoundRepro\ViewModel\MainViewModel.cs:19,13 C#
0x1B in System.Reflection.RuntimeConstructorInfo.InternalInvoke C#
0xF in System.Reflection.MethodBaseInvoker.InterpretedInvoke_Constructor C#
0x2D in System.Reflection.MethodBaseInvoker.InvokeWithNoArgs C#
0xB4 in System.RuntimeType.CreateInstanceMono C#
0x1F in System.RuntimeType.CreateInstanceDefaultCtor C#
0x30 in System.Activator.CreateInstance C#
0x3 in System.Activator.CreateInstance C#
0x2 in System.Activator.CreateInstance C#
0x2B2 in Microsoft.Maui.Controls.Xaml.CreateValuesVisitor.Visit at //src/Controls/src/Xaml/CreateValuesVisitor.cs:102,46 C#
0x93 in Microsoft.Maui.Controls.Xaml.ElementNode.Accept at /
/src/Controls/src/Xaml/XamlNode.cs:189,37 C#
0x48 in Microsoft.Maui.Controls.Xaml.RootNode.Accept at //src/Controls/src/Xaml/XamlNode.cs:240,33 C#
0x6C in Microsoft.Maui.Controls.Xaml.XamlLoader.Visit at /
/src/Controls/src/Xaml/XamlLoader.cs:208,67 C#
0xE4 in Microsoft.Maui.Controls.Xaml.XamlLoader.Load at //src/Controls/src/Xaml/XamlLoader.cs:78,30 C#
0x4 in Microsoft.Maui.Controls.Xaml.XamlLoader.Load at /
/src/Controls/src/Xaml/XamlLoader.cs:53,125 C#
0x2C in Microsoft.Maui.Controls.Xaml.XamlLoader.Load at //src/Controls/src/Xaml/XamlLoader.cs:49,42 C#
0x7 in Microsoft.Maui.Controls.Xaml.Extensions.LoadFromXaml<SimpleAuthFileNotFoundRepro.MainPage> at /
/src/Controls/src/Xaml/ViewExtensions.cs:37,39 C#
0xC in SimpleAuthFileNotFoundRepro.MainPage.InitializeComponent at C:\Users\longp\source\repos\SimpleAuthFileNotFoundRepro\SimpleAuthFileNotFoundRepro\obj\Debug\net8.0-ios\ios-arm64\Microsoft.Maui.Controls.SourceGen\Microsoft.Maui.Controls.SourceGen.CodeBehindGenerator\MainPage.xaml.sg.cs:26,4 C#
0x10 in SimpleAuthFileNotFoundRepro.MainPage..ctor at C:\Users\longp\source\repos\SimpleAuthFileNotFoundRepro\SimpleAuthFileNotFoundRepro\MainPage.xaml.cs:9,13 C#
0x1B in System.Reflection.RuntimeConstructorInfo.InternalInvoke C#
0xF in System.Reflection.MethodBaseInvoker.InterpretedInvoke_Constructor C#
0x2D in System.Reflection.MethodBaseInvoker.InvokeWithNoArgs C#
0xB4 in System.RuntimeType.CreateInstanceMono C#
0x1F in System.RuntimeType.CreateInstanceDefaultCtor C#
0x30 in System.Activator.CreateInstance C#
0x3 in System.Activator.CreateInstance C#
0x2 in System.Activator.CreateInstance C#
0x48 in Microsoft.Maui.Controls.ShellContent. at //src/Controls/src/Core/SwipeView/SwipeView.cs:421,5 C#
0x27 in Microsoft.Maui.Controls.ElementTemplate.CreateContent at /
/src/Controls/src/Core/Element/Element.cs:226,4 C#
0x8 in Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent at //src/Controls/src/Core/Internals/ImageParser.cs:287,37 C#
0x77 in Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent at /
/src/Controls/src/Core/Shell/ShellElementCollection.cs:105,31 C#
0x21 in Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.LoadRenderers at //src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cs:442,36 C#
0xD3 in Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.ViewDidLoad at /
/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cs:331,16 C#
0x38 in UIKit.UIApplication.xamarin_UIApplicationMain C#
0xF in UIKit.UIApplication.UIApplicationMain at /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:61,5 C#
0x4A in UIKit.UIApplication.Main at /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:96,4 C#
0xD in SimpleAuthFileNotFoundRepro.Program.Main at C:\Users\longp\source\repos\SimpleAuthFileNotFoundRepro\SimpleAuthFileNotFoundRepro\Platforms\iOS\Program.cs:13,13 C#

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions