xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.87k forks source link

[Bug] System.TypeLoadException: 'VTable setup of type Xamarin.Forms.Forms+AndroidPlatformServices failed' #13610

Closed ValonK closed 3 years ago

ValonK commented 3 years ago

Description

I cannot Debug my Application because of this Issue `System.TypeLoadException: 'VTable setup of type Xamarin.Forms.Forms+AndroidPlatformServices failed', the same Solution works without Problems on Visual Studio Mac. This Issue appeared with Visual Studio 16.8.4, I cannot downgrade Visual Studio + Tools, is there any known workaround for this?

UPDATE: I was able to Workaround this Issue by using Visual Studio Preview Version 16.9.0

System.TypeLoadException: 'VTable setup of type Xamarin.Forms.Forms+AndroidPlatformServices failed'
no implementation for interface method Xamarin.Forms.Internals.IPlatformServices::GetHash(string) in class Xamarin.Forms.Forms/AndroidPlatformServices

 at Xamarin.Forms.Forms.Init (Android.Content.Context activity, Android.OS.Bundle bundle, System.Reflection.Assembly resourceAssembly) [0x0000f] in <0a23535dd1814c50b499bbf22c007a94>:0 
 at MvvmCross.Forms.Platforms.Android.Core.MvxFormsAndroidSetup.get_FormsApplication () [0x00034] in /_/MvvmCross.Forms/Platforms/Android/Core/MvxFormsAndroidSetup.cs:61 
 at MvvmCross.Forms.Platforms.Android.Core.MvxFormsAndroidSetup.CreateViewPresenter () [0x00000] in /_/MvvmCross.Forms/Platforms/Android/Core/MvxFormsAndroidSetup.cs:86 
 at MvvmCross.Platforms.Android.Core.MvxAndroidSetup.get_Presenter () [0x00000] in /_/MvvmCross/Platforms/Android/Core/MvxAndroidSetup.cs:125 
 at MvvmCross.Platforms.Android.Core.MvxAndroidSetup.RegisterPresenter () [0x00000] in /_/MvvmCross/Platforms/Android/Core/MvxAndroidSetup.cs:142 
 at MvvmCross.Platforms.Android.Core.MvxAndroidSetup.InitializeFirstChance () [0x0000c] in /_/MvvmCross/Platforms/Android/Core/MvxAndroidSetup.cs:49 
 at MvvmCross.Core.MvxSetup.InitializePrimary () [0x00055] in /_/MvvmCross/Core/MvxSetup.cs:82 
 at MvvmCross.Core.MvxSetupSingleton.StartSetupInitialization () [0x0000a] in /_/MvvmCross/Core/MvxSetupSingleton.cs:181 
 at MvvmCross.Core.MvxSetupSingleton.InitializeAndMonitor (MvvmCross.Core.IMvxSetupMonitor setupMonitor) [0x00043] in /_/MvvmCross/Core/MvxSetupSingleton.cs:138 
 at MvvmCross.Platforms.Android.Views.MvxSplashScreenActivity.OnCreate (Android.OS.Bundle bundle) [0x00019] in /_/MvvmCross/Platforms/Android/Views/MvxSplashScreenActivity.cs:55 
 at xHP.Flashtool.Droid.Views.SplashActivity.OnCreate (Android.OS.Bundle bundle) [0x00001] in C:\Dev\xhp-flashtool-2.0\src\xHP.Flashtool\xHP.Flashtool.Droid\Views\SplashActivity.cs:31 
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x0000f] in <84ca7e914f6148f0b961431a9ac4287b>:0 
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.13(intptr,intptr,intptr)

at Xamarin.Forms.Forms.Init (Android.Content.Context activity, Android.OS.Bundle bundle, System.Reflection.Assembly resourceAssembly) [0x0000f] in <0a23535dd1814c50b499bbf22c007a94>:0 
at MvvmCross.Forms.Platforms.Android.Core.MvxFormsAndroidSetup.get_FormsApplication () [0x0003c] in <2b795153316a4bc5a84d737c124a9c04>:0 
at MvvmCross.Forms.Platforms.Android.Core.MvxFormsAndroidSetup.CreateViewPresenter () [0x00006] in <2b795153316a4bc5a84d737c124a9c04>:0 
at MvvmCross.Platforms.Android.Core.MvxAndroidSetup.get_Presenter () [0x00000] in <eefbcb9415fd488397d86314b8258e0b>:0 
at MvvmCross.Platforms.Android.Core.MvxAndroidSetup.RegisterPresenter () [0x00000] in <eefbcb9415fd488397d86314b8258e0b>:0 
at MvvmCross.Platforms.Android.Core.MvxAndroidSetup.InitializeFirstChance () [0x0000c] in <eefbcb9415fd488397d86314b8258e0b>:0 
at MvvmCross.Core.MvxSetup.InitializePrimary () [0x00055] in <eefbcb9415fd488397d86314b8258e0b>:0 
at MvvmCross.Core.MvxSetupSingleton.StartSetupInitialization () [0x0000a] in <eefbcb9415fd488397d86314b8258e0b>:0 
at MvvmCross.Core.MvxSetupSingleton.InitializeAndMonitor (MvvmCross.Core.IMvxSetupMonitor setupMonitor) [0x00043] in <eefbcb9415fd488397d86314b8258e0b>:0 
at MvvmCross.Platforms.Android.Views.MvxSplashScreenActivity.OnCreate (Android.OS.Bundle bundle) [0x00019] in <eefbcb9415fd488397d86314b8258e0b>:0 
at xHP.Flashtool.Droid.Views.SplashActivity.OnCreate (Android.OS.Bundle bundle) [0x00001] in <526bc293114448ac9dc20fb8169b01b1>:0 
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x0000f] in <84ca7e914f6148f0b961431a9ac4287b>:0 
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.12(intptr,intptr,intptr)
at crc6418c2e2122a128b1d.SplashActivity.n_onCreate(Native Method)
at crc6418c2e2122a128b1d.SplashActivity.onCreate(SplashActivity.java:37)
at android.app.Activity.performCreate(Activity.java:8006)
at android.app.Activity.performCreate(Activity.java:7990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3554)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3733)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2198)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:233)
at android.app.ActivityThread.main(ActivityThread.java:7959)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
getAppToken ActivityRecord{dc7a857 u0 net.oneplus.launcher/.Launcher t1912}
setRefreshRate token ActivityRecord{dc7a857 u0 net.oneplus.launcher/.Launcher t1912} rate 0 tmpRate 0

Expected Behavior

Actual Behavior

Basic Information

CsvHelper 2.16.3

Com.OneSignal 3.8.1

LiteDB 4.1.4

Microsoft.AppCenter 3.4.2

Microsoft.AppCenter.Analytics 3.4.2

Microsoft.AppCenter.Crashes 3.4.2

Microsoft.AppCenter.Distribute 3.4.2

Microsoft.AppCenter.Push 3.4.2

MvvmCross 7.0.1

MvvmCross.Forms 7.0.1

NLog 4.7.2

Plugin.CurrentActivity 2.1.0.4

Plugin.Permissions 3.0.0.12

Plugin.StoreReview 2.0.0.5

Xamarin.Android.Support.Annotations 28.0.0.3

Xamarin.Android.Support.Interpolator 28.0.0.3

Xamarin.Android.Support.CustomTabs 28.0.0.3

Xamarin.Android.Support.Compat 28.0.0.3

Xamarin.Android.Support.Core.UI 28.0.0.3

Xamarin.Android.Support.Core.Utils 28.0.0.3

Xamarin.Android.Support.Fragment 28.0.0.3

Xamarin.Android.Support.Media.Compat 28.0.0.3

Xamarin.Android.Support.Design 28.0.0.3

Xamarin.Android.Support.v4 28.0.0.3

Xamarin.Android.Support.V7.AppCompat 28.0.0.3

Xamarin.Android.Support.v7.MediaRouter 28.0.0.3

Xamarin.AndroidX.AppCompat.Resources 1.1.0.1

Xamarin.AndroidX.Browser 1.2.0.2

Xamarin.AndroidX.Legacy.Support.V4 1.0.0.4

Xamarin.AndroidX.Lifecycle.LiveData 2.2.0.2

Xamarin.AndroidX.MediaRouter 1.1.0.4

Xamarin.AndroidX.Migration 1.0.7.1

Xamarin.BlurView 1.4.0

Xamarin.FFImageLoading 2.4.11.982

Xamarin.FFImageLoading.Forms 2.4.11.982

Xamarin.FFImageLoading.Transformations 2.4.11.982

Xamarin.Firebase.Messaging 71.1740.0

Xamarin.Forms 4.8.0.1451

Xamarin.Google.Android.Material 1.0.0.1

Xamarin.GooglePlayServices.Base 71.1610.4

Xamarin.GooglePlayServices.Basement 71.1620.4

Environment

Show/Hide Visual Studio info ``` Microsoft Visual Studio Professional 2019 Version 16.8.4 VisualStudio.16.Release/16.8.4+30907.101 Microsoft .NET Framework Version 4.8.04084 Installed Version: Professional Visual C++ 2019 00435-60000-00000-AA944 Microsoft Visual C++ 2019 ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools ASA Service Provider 1.0 ASP.NET and Web Tools 2019 16.8.557.25636 ASP.NET and Web Tools 2019 ASP.NET Core Razor Language Services 16.1.0.2052803+84e121f1403378489b842e1797df2f3f5a49ac3c Provides languages services for ASP.NET Core Razor. ASP.NET Web Frameworks and Tools 2019 16.8.557.25636 For additional information, visit https://www.asp.net/ Azure App Service Tools v3.0.0 16.8.557.25636 Azure App Service Tools v3.0.0 Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer. Azure Data Lake Tools for Visual Studio 2.6.1000.0 Microsoft Azure Data Lake Tools for Visual Studio Azure Functions and Web Jobs Tools 16.8.557.25636 Azure Functions and Web Jobs Tools Azure Stream Analytics Tools for Visual Studio 2.6.1000.0 Microsoft Azure Stream Analytics Tools for Visual Studio C# Tools 3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools. Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration. Fabric.DiagnosticEvents 1.0 Fabric Diagnostic Events IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info JetBrains ReSharper 2020.3.2 Build 203.0.20201229.111204 JetBrains ReSharper package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper. Copyright © 2021 JetBrains, Inc. Microsoft Azure HDInsight Azure Node 2.6.1000.0 HDInsight Node under Azure Node Microsoft Azure Hive Query Language Service 2.6.1000.0 Language service for Hive query Microsoft Azure Service Fabric Tools for Visual Studio 16.0 Microsoft Azure Service Fabric Tools for Visual Studio Microsoft Azure Stream Analytics Language Service 2.6.1000.0 Language service for Azure Stream Analytics Microsoft Azure Stream Analytics Node 1.0 Azure Stream Analytics Node under Azure Node Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30924.1 Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE. Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Microsoft Library Manager 2.1.113+g422d40002e.RR Install client-side libraries easily to any web project Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container. Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package Mono Debugging for Visual Studio 16.8.43 (00471f8) Support for debugging Mono processes with Visual Studio. Node.js Tools 1.5.20902.1 Commit Hash:b474efcb6f92db52a8f8e2e6a8cb9648476885cc Adds support for developing and debugging Node.js apps in Visual Studio NuGet Package Manager 5.8.1 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info SQL Server Data Tools 16.0.62012.31170 Microsoft SQL Server Data Tools Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory. Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory. ToolWindowHostedEditor 1.0 Hosting json editor into a tool window TypeScript Tools 16.0.21016.2001 TypeScript Tools for Microsoft Visual Studio Visual Basic Tools 3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual F# Tools 16.8.0-beta.20507.4+da6be68280c89131cdba2045525b80890401defd Microsoft Visual F# Tools Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio Visual Studio Container Tools Extensions 1.0 View, manage, and diagnose containers within Visual Studio. Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers Visual Studio Tools for Kubernetes 1.0 Visual Studio Tools for Kubernetes VisualStudio.DeviceLog 1.0 Information about my package VisualStudio.Foo 1.0 Information about my package VisualStudio.Mac 1.0 Mac Extension for Visual Studio Xamarin 16.8.000.261 (d16-8@bb99248) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android. Xamarin Designer 16.8.0.507 (remotes/origin/d16-8@e87b24884) Visual Studio extension to enable Xamarin Designer tools in Visual Studio. Xamarin Templates 16.8.112 (86385a3) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms. Xamarin.Android SDK 11.1.0.26 (d16-8/a36ce73) Xamarin.Android Reference Assemblies and MSBuild support. Mono: 5e9cb6d Java.Interop: xamarin/java.interop/d16-8@79d9533 ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000 SQLite: xamarin/sqlite/3.32.1@1a3276b Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc Xamarin.iOS and Xamarin.Mac SDK 14.8.0.3 (c51fabee8) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support. ```

Build Logs

Screenshots

Reproduction Link

Workaround

rachelkang commented 3 years ago

Hi, @ValonK - it sounds like the issue you were experiencing was fixed in the newer version of VS you're using, so I'll be closing this issue. If you encounter this issue again, however, please feel free to reopen with added details on the situation of how/when you encounter this exception!