After update to xamarin forms 3.6->4.2, prism.Autofac.Forms 7.0->7.1, and xamarin.android.support.% 28.0.0.1->28.0.0.3 I'm getting
System.TypeLoadException
Message=VTable setup of type Prism.Autofac.AutofacContainerExtension failed
stack trace:
at Prism.PrismApplicationBase.Initialize () [0x00000] in d:\a\1\s\Source\Xamarin\Prism.Forms\PrismApplicationBase.cs:130
at Prism.PrismApplicationBase.InitializeInternal () [0x00006] in d:\a\1\s\Source\Xamarin\Prism.Forms\PrismApplicationBase.cs:84
at Prism.PrismApplicationBase..ctor (Prism.IPlatformInitializer platformInitializer, System.Boolean setFormsDependencyResolver) [0x00038] in d:\a\1\s\Source\Xamarin\Prism.Forms\PrismApplicationBase.cs:75
at Prism.PrismApplicationBase..ctor (Prism.IPlatformInitializer platformInitializer) [0x00000] in d:\a\1\s\Source\Xamarin\Prism.Forms\PrismApplicationBase.cs:57
at Prism.Autofac.PrismApplication..ctor (Prism.IPlatformInitializer platformInitializer) [0x00000] in D:\a\1\s\Source\Xamarin\Prism.Autofac.Forms\PrismApplication.cs:30
at DisMobi.App..ctor (Prism.IPlatformInitializer initializer) [0x00000] in C:...........\App.xaml.cs:28
at xxxxxx.Droid.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00079] in C:..........\xxxxxx.Android\MainActivity.cs:35
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in :0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.3(intptr,intptr,intptr)
I am sometimes getting the following exception:
Unhandled Exception: Android.Runtime.JavaProxyThrowable: Exception of type 'Android.Runtime.JavaProxyThrowable' was thrown.
--- End of managed Android.Runtime.JavaProxyThrowable stack trace ---
android.runtime.JavaProxyThrowable: System.NotSupportedException: Unable to activate instance of type TaxiTabletUniversal.Droid.Views.SoftMeterView from native handle 0xbe8cfb2c (key_handle 0x369e8281). ---> System.MissingMethodException: No constructor found for TaxiTabletUniversal.Droid.Views.SoftMeterView::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00054] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00111] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x0017d] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Java.Lang.Object.GetObject (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type type) [0x000b9] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Java.Lang.Object._GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00017] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Java.Lang.Object.GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00000] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Java.Lang.Object.GetObject[T] (System.IntPtr jnienv, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00006] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at Android.Views.ViewTreeObserver+IOnGlobalLayoutListenerInvoker.n_OnGlobalLayout (System.IntPtr jnienv, System.IntPtr native__this) [0x00000] in <5ade030ddd6b4e4c9dda56516f1de4fe>:0
at (wrapper dynamic-method) System.Object.90422e09-526e-4347-b02e-8c2980bde53e(intptr,intptr)
at mvvmcross.droid.views.MvxActivity.n_onGlobalLayout(Native Method)
at mvvmcross.droid.views.MvxActivity.onGlobalLayout(MvxActivity.java:84)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:986)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2221)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1306)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7031)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:821)
at android.view.Choreographer.doCallbacks(Choreographer.java:606)
at android.view.Choreographer.doFrame(Choreographer.java:576)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:807)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6914)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
with the bit that stands out from that exception saying :
No constructor found for TaxiTabletUniversal.Droid.Views.SoftMeterView::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership)
But the class SoftmeterView (derived from MvxActivity) does have 2 constructors:
public SoftMeterView() : base()
{
MoveTaskToBack(true);
IsCreated = true;
}
with the second one matching the exact signature the exception is complaining about:
public SoftMeterView(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
MoveTaskToBack(true);
IsCreated = true;
}
any thoughts ?
I am trying to implement Overlay view from the Link. In android it is working fine but showing System.MissingMethodException on UIApplication.Main(args, null, "AppDelegate");
Upadated
System.MissingMethodException: Default constructor not found for type VenkysHRMS.iOS.ShowOverlay
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x00066] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/RuntimeType.cs:171
at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/mcs/class/corlib/ReferenceSources/RuntimeType.cs:153
at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00027] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/rttype.cs:5639
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00039] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:201
at System.Activator.CreateInstance (System.Type type) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/activator.cs:134
at Xamarin.Forms.DependencyService.Get[T] (Xamarin.Forms.DependencyFetchTarget fetchTarget) [0x00065] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\DependencyService.cs:35
at VenkysHRMS.View.Login+<OnCreate>d__2.MoveNext () [0x0001b] in /Users/mac/Desktop/VenkysHRMS/VenkysHRMS/VenkysHRMS/View/Login.xaml.cs:33
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018
at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/UIKit/UIKitSynchronizationContext.cs:24
at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/Foundation/NSAction.cs:163
at at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.9.1.24/src/Xamarin.iOS/UIKit/UIApplication.cs:63
at VenkysHRMS.iOS.Application.Main (System.String[] args) [0x00001] in /Users/mac/Desktop/VenkysHRMS/VenkysHRMS/VenkysHRMS.iOS/Main.cs:17
I am working on an android app using Xamarin and receive the following exception.
Xamarin caused by: android.runtime.JavaProxyThrowable: System.ArgumentException: Handle must be valid.
Parameter name: instance
at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0000d] in <1bc3ec2e392f4f1a8cde1c9a163d2a4a>:0
at Android.Runtime.JNIEnv.CallVoidMethod (System.IntPtr jobject, System.IntPtr jmethod, Android.Runtime.JValue* parms) [0x0000e] in <0ce7e7a03dfb4c4b87eaf38b0e480d65>:0
at Android.Support.V4.Widget.SwipeRefreshLayout.set_Refreshing (System.Boolean value) [0x00060] in <27c17fe440cf491ba8255bcefade6e02>:0
at Xamarin.Forms.Platform.Android.ListViewRenderer.<UpdateIsRefreshing>b__25_0 () [0x00000] in <a3e44144fef249b0888b761605dfca24>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in <0ce7e7a03dfb4c4b87eaf38b0e480d65>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <0ce7e7a03dfb4c4b87eaf38b0e480d65>:0
at (wrapper dynamic-method) System.Object:ffc21647-8320-4065-b329-c8e7939eb92d (intptr,intptr)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I've tried adding a txt file, environment.txt, with the property to set the GC to old. However that did not work.
What other issues could cause this exception?
I'm able to host a small MVC3 application on Mono, but when trying to host my real site, I get some exceptions.
Versions:
Mono 2.10.6
C#4
MVC3 using Razor
NHibernate 3.1.0.4
FluentNHibernate 1.2.0.712
MySql.Data 6.4.4.0
MvcContrib 3.0.51.0
Here I'm trying to run xsp4 on my Windows box, but I get the same error on Linux.
I don't get any additional information using --verbose. Does anybody know why this error occur, or how I can get some additional information on the error?
Handling exception type TargetInvocationException
Message is Exception has been thrown by the target of an invocation.
IsTerminating is set to True
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Server stack trace:
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0
at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] in :0
at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000] in :0
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject
(System.IO.BinaryReader reader) [0x00000] in :0
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (BinaryElement elem, System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x00000]
in :0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in :0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(System.IO.Stream serializationStream) [0x00000] in :0
at System.Runtime.Remoting.RemotingServices.DeserializeCallData (System.Byte[] array) [0x00000] in :0
at (wrapper xdomain-dispatch) System.AppDomain:DoCallBack (object,byte[]&,byte[]&)
Exception rethrown at [0]:
---> System.ArgumentException: Couldn't bind to method 'SetHostingEnvironment'.
at System.Delegate.GetCandidateMethod (System.Type type, System.Type target, System.String method, BindingFlags bflags, Boolean ignoreCase, Boolean throwOnBindFailure) [0x00000] in :0
at System.Delegate.CreateDelegate (System.Type type, System.Type target, System.String method, Boolean ignoreCase, Boolean throwOnBindFailure) [0x00000] in :0
at System.Delegate.CreateDelegate (System.Type type, System.Type target, System.String method) [0x00000] in :0
at System.DelegateSerializationHolder+DelegateEntry.DeserializeDelegate (System.Runtime.Serialization.SerializationInfo info) [0x00000] in :0
at System.DelegateSerializationHolder..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext ctx) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
--- End of inner exception stack trace ---
at (wrapper xdomain-invoke) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate)
at (wrapper remoting-invoke-with-check) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate)
at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) [0x00000] in :0
at Mono.WebServer.VPathToHost.CreateHost (Mono.WebServer.ApplicationServer server, Mono.WebServer.WebSource webSource) [0x00000] in :0
at Mono.WebServer.XSP.Server.RealMain (System.String[] args, Boolean root, IApplicationHost ext_apphost, Boolean quiet) [0x00000] in :0
at Mono.WebServer.XSP.Server.Main (System.String[] args) [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation.
Server stack trace:
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0
at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] in :0
at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000] in :0
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject
(System.IO.BinaryReader reader) [0x00000] in :0
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (BinaryElement elem, System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x00000]
in :0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in :0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(System.IO.Stream serializationStream) [0x00000] in :0
at System.Runtime.Remoting.RemotingServices.DeserializeCallData (System.Byte[] array) [0x00000] in :0
at (wrapper xdomain-dispatch) System.AppDomain:DoCallBack (object,byte[]&,byte[]&)
Exception rethrown at [0]:
---> System.ArgumentException: Couldn't bind to method 'SetHostingEnvironment'.
at System.Delegate.GetCandidateMethod (System.Type type, System.Type target, System.String method, BindingFlags bflags, Boolean ignoreCase, Boolean throwOnBindFailure) [0x00000] in :0
at System.Delegate.CreateDelegate (System.Type type, System.Type target, System.String method, Boolean ignoreCase, Boolean throwOnBindFailure) [0x00000] in :0
at System.Delegate.CreateDelegate (System.Type type, System.Type target, System.String method) [0x00000] in :0
at System.DelegateSerializationHolder+DelegateEntry.DeserializeDelegate (System.Runtime.Serialization.SerializationInfo info) [0x00000] in :0
at System.DelegateSerializationHolder..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext ctx) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
--- End of inner exception stack trace ---
at (wrapper xdomain-invoke) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate)
at (wrapper remoting-invoke-with-check) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate)
at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) [0x00000] in :0
at Mono.WebServer.VPathToHost.CreateHost (Mono.WebServer.ApplicationServer server, Mono.WebServer.WebSource webSource) [0x00000] in :0
at Mono.WebServer.XSP.Server.RealMain (System.String[] args, Boolean root, IApplicationHost ext_apphost, Boolean quiet) [0x00000] in :0
at Mono.WebServer.XSP.Server.Main (System.String[] args) [0x00000] in :0
I found the reason. I had several System.Web.* dll's in by bin folder. Removing these fixes the problem.
The problem persists on MVC 4/5 too. The dll is System.Web.dll. It must be deleted when publishing to mono.
Create a Mvc project with Xamarin. The dll that you need will be in the bin folder. Will work just fine