Xamarin forms error LoadApplication(new App()); [duplicate] - xamarin

This question already has answers here:
Updating Nuget caused Exception Unhandled: System.TypeLoadException
(3 answers)
Closed 3 years ago.
I just created a new cross-platform project and run the app without writing any code or change any configuration and i got the following error:
Unhandled Exception:
System.TypeLoadException: Could not load type of field 'Xamarin.Forms.Platform.Android.RendererPool:_freeRenderers' (0) due to: Could not resolve type with token 0100027b from typeref (expected class 'System.Collections.Generic.Stack1' in assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e') assembly:mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e type:System.Collections.Generic.Stack1 member:(null) occurred
I tired to update Nuget packages, remove bin and obj then rebuild. still error occurs.

Your issue is tracked on the Xamarin Forms Github Issues page and seems to be quite common. The solution seems to be to make sure that you have the latest version of Visual Studio installed. Let me know if that doesn't work.

Related

Using xamarin forms, still getting warning for UIWebView deprecation in app store "ITMS-90809: Deprecated API Usage"

I have removed all UIWebView references and using WKWebView now.
I am hoping any one will help me as I am stuck.
The apple depreciation warning still
persists even after following the above steps in
https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-forms/.
My nugets are updated as per the article. And removed "obj" and "bin" folders from
ios project to just not use previous references.
I have following details:
MacMini
OS: macOS-10.15 (Catalina)
Visual Studio: 8.6.2
Xamarin.iOS: 13.18.2.1
XCode: 11.5
Xamarin.Forms: 4.8.0.1269
Xamarin.Forms.Maps: 4.8.0.1269
Xamarin.Essentials: 4.5.3.2
Xamarin.Auth: 1.7.0
But it still giving me
UIKit.UIWebView reference in following dll
One or more reference(s) to type ‘UIKit.UIWebView’ still exists inside
‘Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
One or more reference(s) to type ‘UIKit.UIWebView’ still exists inside ‘Xamarin.Auth,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
One or more reference(s) to type UIKit.UIWebView still exists inside
‘Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
One or more reference(s) to type ‘UIKit.UIWebView’ still exists inside ‘Xamarin.Auth,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
At this stage, I cannot figure out what I am missing
As it says in the error message that you are getting,
One or more reference(s) to type ‘UIKit.UIWebView’ still exists inside ‘Xamarin.Auth,
So, you need to stop using "Xamarin.Auth" as it still references UIWebView.
There's also an issue filed in the Github of that nuget. Even though there's a PR already submitted to fix that issue, but they are not going to fix it because Xamarin.Auth is not safe for use. They have made it clear that the library is deprecated, so you have to start using the SecureStorage provided by Xamarin Essentials. They even wrote a migration guide to help you with this.
So, please migrate and then delete that Xamarin.Auth package. Make sure you update the packages to the latest version and then resubmit.
This seems an existing issue of Xamarin.forms on iOS .
Make sure that the version Xamarin.Forms is 4.6 or higher and Xamarin.iOS is 13.10.0.17 or higher.
Change the Linker Behavior to SDK Only or Link All and then add the
additional arguments: --optimize=experimental-xforms-product-type
Please check all of these have been set under the release
configuration and iPhone platform.
For more details you could refer
https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-forms/
Hi I fixed my issue by removing Xamarin Auth package. And also set mTouch argument to AppStore/iPhone iOS build configuration. It is working now. I didn't get any warning message from apple.

Any ideas on how to handle a Framework resource extraction failed. error that mysteriously started showing up in UWP

I started getting the following error in UWP today and have no explanation as to where it came from
C:\Users\chris.nuget\packages\microsoft.net.uwpcoreruntimesdk\2.2.9\tools\CoreRuntime\Microsoft.Net.CoreRuntime.targets(195,9):
Error
Framework resource extraction failed. This .resources file should not be read with this reader. The resource reader type is "System.Resources.Extensions.DeserializingResourceReader, System.Resources.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
btw: line 195 of Microsoft.Net.CoreRunTime.targets is
<ResourceHandlingTask
AssemblyList="#(_FullAppLibrariesUnfiltered)"
OutResWPath="$(ResWOutputFullPath)"
SkipFrameworkResources="$(SkipMergingFrameworkResources)"
StateFile="$(ResWOutputFullPath.TrimEnd('\'))\ResourceHandlingTask.state">
I've tried checking out a previous version of code in Git when everything built and this little beauty is still there. Cleaning all projects, updating to the latest Visual Studio, reverting nuget packages, nothing seems to help.
Any ideas?

Xamarin Refit - Could not load assembly error

I am new to Xamarin platform and just give it a try this week.
And when I import Refit and use it somewhere, it come out this error:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Refit, Version=3.0.1.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Refit.dll'
How to resolve this? it seem like android related error but I no idea how to solve it, I new to C# as well.
Thanks for help

Xamarin, updating app to Unified mvvmCross not compiling

After update existing app to the Unified API, and update the mvvmCross libraries to 3.5, when I try to compile in Iphone the nex error is show:
Failed to resolve "System.Boolean Cirrious.VvvmCross.ViewModels.MvxNavigatingObject::ShowViewModel(Cirrious.MvvmCross.ViewModels.IMvxBundle,Cirrious.MvvmCross.ViewModels.MvxBundle,Cirrious.MvvmCross.ViewModels.MvxRequestedBy)" reference from "Cirrious.MvvmCross, Version=1.0.0.0, Culture=neutral, PublickKeyToken = e16445fd9b451819" (MT2002)
Archive: MTOUCHTASK
And if I double click in the error, then I get the message:
File not found: /User/Admin/Desktop/Project/iPhoneProject/MTOUCHTASK
What I'm missing? I have to update somthing else?
P.D.: I Updated Xamarin as well.
It was all a problem with the Profile of the PCL that I used in the xamarin.
I changed all the PCL to use Profile78 and then all worked so far.

getting unspecified error while compiling a WP7 program

im receiving a very weird error from the IDE while compiling.
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight for
Phone\v4.0\Microsoft.Phone.PreImport.targets(38,9): error : Could not
load file or assembly '0 bytes loaded from System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its
dependencies. An attempt was made to load a program with an incorrect
format.
what really makes this weird is the fact that on another computer the program is compilable.
thanks for your help
edit: just found out that the reason for that error is because of the panorama -view.. i tried to create a new project with a panorama view, still received same error
Do you have the correct references in the project?
Did you modify any of the "stock" references?
You could try repairing the SDK or create a new Panorama-based application and see if it works.

Resources