无论Debug / Release如何,Xamarin都会在启动时形成应用程序崩溃

时间:2017-06-07 08:31:20

标签: c# android xamarin xamarin.android xamarin.forms

我的Xamarin Forms应用程序遇到了这个奇怪的问题。它似乎在启动时崩溃。我尝试更改Android链接器设置,但无论设置如何,它似乎仍然崩溃。它曾用于调试模式但不再工作。我试过删除bin和obj文件。我尝试删除和更新NuGet包。任何帮助,将不胜感激。我已经为任何缺少的构造函数检查了“主要活动”方法,但似乎没有任何遗漏。

以下是堆栈跟踪:

[ERROR] FATAL UNHANDLED EXCEPTION: System.NotSupportedException: Could not activate JNI Handle 0xbfe1bd38 (key_handle 0xfcb6ecf) of Java type 'md5a4d2fdb8e3028a798e3d0ab6628e2c4b/MainActivity' as managed type 'TeaTotal.Droid.MainActivity'. ---> System.TypeInitializationException: The type initializer for 'TeaTotal.Droid.MainActivity' threw an exception. ---> System.MissingMethodException: Default constructor not found for type Microsoft.WindowsAzure.MobileServices.CurrentPlatform
   at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x00085] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs:171 
   at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x0001a] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs:153 
   at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x0002a] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/referencesource/mscorlib/system/rttype.cs:5638 
   at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00040] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/referencesource/mscorlib/system/activator.cs:201 
   at System.Activator.CreateInstance (System.Type type) [0x00000] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/referencesource/mscorlib/system/activator.cs:134 
   at Microsoft.WindowsAzure.MobileServices.Platform.get_Instance () [0x00054] in <77043900ca604149b85ba57dba9fe35b>:0 
   at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.GetApplicationInstallationId () [0x00004] in <77043900ca604149b85ba57dba9fe35b>:0 
   at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.Uri applicationUri, System.String applicationKey, System.Net.Http.HttpMessageHandler[] handlers) [0x00028] in <77043900ca604149b85ba57dba9fe35b>:0 
   at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.Uri applicationUri, System.String applicationKey) [0x00000] in <77043900ca604149b85ba57dba9fe35b>:0 
   at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.Uri applicationUri) [0x00000] in <77043900ca604149b85ba57dba9fe35b>:0 
   at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.String applicationUrl) [0x00007] in <77043900ca604149b85ba57dba9fe35b>:0 
   at TeaTotal.Droid.MainActivity..cctor () [0x00000] in C:\TT\Droid\MainActivity.cs:31 

0 个答案:

没有答案