Related
Been bashing my head for the past few days trying to port my droid app to iOS.
Most of the code is in-house, just using UnityAds, SIS (Simple IAP System) and GooglePlayGames plugins.
With IL2CCP on, it won't even build on Unity 5 (latest version). I get the following errors:
IL2CPP error for type 'GooglePlayGames.Native.PInvoke.PInvokeUtilities/OutStringMethod' in assembly '/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll'
Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation.
Failed running /Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/il2cpp.exe --copy-level=None --enable-generic-sharing --enable-unity-event-support --emit-null-checks --enable-array-bounds-check --enable-symbol-loading
"/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll"
"/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll"
"/Temp/StagingArea/Data/Managed/Assembly-UnityScript.dll"
"/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll" "/Temp/StagingArea/Data/Managed/OpenIAB_W8Plugin.dll" "/Temp/StagingArea/Data/Managed/UnityEngine.Cloud.Analytics.dll"
"/Temp/il2cppOutput/il2cppOutput"
stdout:
IL2CPP error for type 'GooglePlayGames.Native.PInvoke.PInvokeUtilities/OutStringMethod' in assembly '/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll'
Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation.
stderr:
Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Cannot cast from source type to destination type.
at Unity.IL2CPP.IncludeCollection.NonTemplated.TypeDefinitionVisitor.HandleDelegate (Mono.Cecil.TypeDefinition typeDefinition) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.TypeDefinitionVisitor.Visit (Mono.Cecil.TypeDefinition typeDefinition, Unity.Cecil.Visitor.Context context) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.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 System.Reflection.MonoMethod.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 Unity.Cecil.Visitor.Visitor.VisitTypeDefinition [0x00000] in :0
at Unity.Cecil.Visitor.Extensions.DoAcceptTypeDefinition [0x00000] in :0
at Unity.Cecil.Visitor.Extensions.Accept (Mono.Cecil.TypeDefinition typeDefinition, Unity.Cecil.Visitor.Visitor visitor) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.IncludeCollector.ForTypeDefinition (Mono.Cecil.TypeDefinition type) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.IncludeCollector.ForTypeDefinition (Mono.Cecil.TypeReference type) [0x00000] in :0
at Unity.IL2CPP.IncludeWriter.WriteTypeDefinitionIncludes (Mono.Cecil.TypeReference type, Unity.IL2CPP.CppCodeWriter writer) [0x00000] in :0
at Unity.IL2CPP.SourceWriter.WriteTypeDefinitionFor (System.String outputDirectory, Mono.Cecil.TypeReference type) [0x00000] in :0
at Unity.IL2CPP.SourceWriter.Write (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics, System.String outputDir, Mono.Cecil.TypeDefinition[] typeList, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection) [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.Convert (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics) [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.Apply () [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies (System.String[] assemblies, System.String outputDir) [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Cannot cast from source type to destination type.
at Unity.IL2CPP.IncludeCollection.NonTemplated.TypeDefinitionVisitor.HandleDelegate (Mono.Cecil.TypeDefinition typeDefinition) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.TypeDefinitionVisitor.Visit (Mono.Cecil.TypeDefinition typeDefinition, Unity.Cecil.Visitor.Context context) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.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 System.Reflection.MonoMethod.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 Unity.Cecil.Visitor.Visitor.VisitTypeDefinition [0x00000] in :0
at Unity.Cecil.Visitor.Extensions.DoAcceptTypeDefinition [0x00000] in :0
at Unity.Cecil.Visitor.Extensions.Accept (Mono.Cecil.TypeDefinition typeDefinition, Unity.Cecil.Visitor.Visitor visitor) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.IncludeCollector.ForTypeDefinition (Mono.Cecil.TypeDefinition type) [0x00000] in :0
at Unity.IL2CPP.IncludeCollection.NonTemplated.IncludeCollector.ForTypeDefinition (Mono.Cecil.TypeReference type) [0x00000] in :0
at Unity.IL2CPP.IncludeWriter.WriteTypeDefinitionIncludes (Mono.Cecil.TypeReference type, Unity.IL2CPP.CppCodeWriter writer) [0x00000] in :0
at Unity.IL2CPP.SourceWriter.WriteTypeDefinitionFor (System.String outputDirectory, Mono.Cecil.TypeReference type) [0x00000] in :0
at Unity.IL2CPP.SourceWriter.Write (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics, System.String outputDir, Mono.Cecil.TypeDefinition[] typeList, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection) [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.Convert (Mono.Cecil.AssemblyDefinition assemblyDefinition, Unity.IL2CPP.StringLiterals.StringLiteralCollection stringLiteralCollection, Unity.IL2CPP.GenericsCollection.InflatedCollection allGenerics) [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.Apply () [0x00000] in :0
at Unity.IL2CPP.AssemblyConverter.ConvertAssemblies (System.String[] assemblies, System.String outputDir) [0x00000] in :0
UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:66)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection1, String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:404) UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:275) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211)
UnityEditor.HostView:OnGUI()
Exception: /Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/il2cpp.exe did not run properly!
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:68)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (ICollection1 userAssemblies, System.String outputDirectory, System.String workingDirectory) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:404) UnityEditorInternal.IL2CPPBuilder.Run () (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:275) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, IIl2CppPlatformProvider platformProvider, System.Action1 modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:211)
UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (UnityEditor.iOS.iOSBuildPostprocessor pp, BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String stagingAreaDataManaged, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.iOS.iOSBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
UnityEditor.HostView:OnGUI()
Error building Player: Exception: /Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/il2cpp.exe did not run properly!
See here:
http://forum.unity3d.com/threads/il2cpp-exe-error.311499/
and here:
https://github.com/playgameservices/play-games-plugin-for-unity/issues/433
Others are having the issue, specifically with the Google game play services plugin. I don't see a solution yet, but a Unity employee on the Unity link said he would look into it.
Update: The latest Unity patch 5.0.0p2 fixed this error for me:
http://unity3d.com/unity/qa/patch-releases
I am trying to write an MvvmCross app using StoryBoards. I know there are similar questions, but I have followed the solutions and I cannot get it to work. I have referenced one of the solutions I have tried in this question.
I'll explain what I have done from the beginning, hopefully this will help in the diagnosis of my problem
Create a project using the the Universal iOS Single View App in Visual Studio.
I do the standard MvvmCross setup, adding nuget, updating AppDelegate etc.
I get it to compile.
I add a new ViewController to the iPhone storyboard. I call it LogonViewController. I set the Class, Storyboard ID and Restoration ID to LogonViewController. The LogonViewController class is generated. I change it to derive it from MvxViewController
I move the entry arrow from the RootViewController (the view controller on the storyboard when it was initially created) to point to the LogonViewController. I leave the RootViewController on the storyboard
I Change the LogonViewController class to derive from MvxViewController and set the Register attribute to LogonView eg
[Register ("LogonView")]
partial class LogonViewController
I add a label to the LogonViewController just as something to display.
I create a custom container derived from MvxTouchViewsContainers as per the post in
MVVMCross support for Xamarin.iOS Storyboards
The problem is that when the overridden method (shown below) is called in the custom container I get An invalid cast exception as it cannot cast a UIKit.UIViewController to a IMvxTouchView
I also get an arithmetic overflow exception
protected override IMvxTouchView CreateViewOfType(Type viewType, MvxViewModelRequest request)
{
return (IMvxTouchView)UIStoryboard.FromName("MyStoryBoard", null)
.InstantiateViewController(viewType.Name);
}
In the trace log I get the following errors
2015-01-28 18:12:09.833 MyApp[3743:68927] mvx:Diagnostic: 8.61 Setup: LastChance start
[0:] mvx:Diagnostic: 8.61 Setup: LastChance start
[0:]
2015-01-28 18:12:10.247 MyApp[3743:68927] mvx:Diagnostic: 9.05 Setup: Secondary end
[0:] mvx:Diagnostic: 9.05 Setup: Secondary end
[0:]
2015-01-28 18:12:10.647 MyApp[3743:68927] mvx:Diagnostic: 9.43 Showing ViewModel LogonViewModel
[0:] mvx:Diagnostic: 9.43 Showing ViewModel LogonViewModel
[0:]
2015-01-28 18:12:11.049 MyApp[3743:68927] TouchNavigation:Diagnostic: 9.83 Navigate requested
[0:] TouchNavigation:Diagnostic: 9.83 Navigate requested
2015-01-28 18:12:11.254 MyApp[3743:68927] Unknown class LogonViewController in Interface Builder file.
2015-01-28 18:12:23.962 MyApp[3743:68927] -[UIViewController bottomLayoutGuide]: guide not available before the view controller's view is loaded
System.OverflowException: Arithmetic operation resulted in an overflow.
at Mono.Debugging.Soft.SoftDebuggerAdaptor.TargetObjectToObject(EvaluationContext ctx, Object obj)
at Mono.Debugging.Evaluation.ExpressionEvaluator.TargetObjectToExpression(EvaluationContext ctx, Object obj)
at Mono.Debugging.Evaluation.ObjectValueAdaptor.CreateObjectValueImpl(EvaluationContext ctx, IObjectValueSource source, ObjectPath path, Object obj, ObjectValueFlags flags)
at Mono.Debugging.Evaluation.ObjectValueAdaptor.CreateObjectValue(EvaluationContext ctx, IObjectValueSource source, ObjectPath path, Object obj, ObjectValueFlags flags)
System.OverflowException: Arithmetic operation resulted in an overflow.
at Mono.Debugging.Soft.SoftDebuggerAdaptor.TargetObjectToObject(EvaluationContext ctx, Object obj)
at Mono.Debugging.Evaluation.ExpressionEvaluator.TargetObjectToExpression(EvaluationContext ctx, Object obj)
at Mono.Debugging.Evaluation.ObjectValueAdaptor.CreateObjectValueImpl(EvaluationContext ctx, IObjectValueSource source, ObjectPath path, Object obj, ObjectValueFlags flags)
at Mono.Debugging.Evaluation.ObjectValueAdaptor.CreateObjectValue(EvaluationContext ctx, IObjectValueSource source, ObjectPath path, Object obj, ObjectValueFlags flags)
System.OverflowException: Arithmetic operation resulted in an overflow.
at Mono.Debugging.Soft.SoftDebuggerAdaptor.TargetObjectToObject(EvaluationContext ctx, Object obj)
at Mono.Debugging.Evaluation.ExpressionEvaluator.TargetObjectToExpression(EvaluationContext ctx, Object obj)
at Mono.Debugging.Evaluation.ObjectValueAdaptor.CreateObjectValueImpl(EvaluationContext ctx, IObjectValueSource source, ObjectPath path, Object obj, ObjectValueFlags flags)
at Mono.Debugging.Evaluation.ObjectValueAdaptor.CreateObjectValue(EvaluationContext ctx, IObjectValueSource source, ObjectPath path, Object obj, ObjectValueFlags flags)
Unhandled Exception:
System.InvalidCastException: Unable to cast object of type 'UIKit.UIViewController' to type 'Cirrious.MvvmCross.Touch.Views.IMvxTouchView'.
I'm at a loss to know what I am doing wrong here. Has anyone got any ideas? This is the versions of software installed
MvvmCross 3.5.0
Visual Studio 2012 Update 4,
Xamarin Universal Installer v3.5.0.0
Xamarin Studio 5.7 v5.7.0.661
Xamarin v3.9.236.0
Update
I took EShy's advice and added the controller and named it LogonView, however I still get a problem where the LogonViewModel is not getting contructed. The log is shown below. Any ideas?
2015-01-29 11:31:33.579 MyApp[12631:273902] mvx:Diagnostic:286.77 Message = [Failed to construct and initialize ViewModel for type MyApp.Core.ViewModels.LogonViewModel from locator MvxDefaultViewModelLocator - check InnerException for more information]
[0:] mvx:Diagnostic:286.77 Message = [Failed to construct and initialize ViewModel for type MyApp.Core.ViewModels.LogonViewModel from locator MvxDefaultViewModelLocator - check InnerException for more information]
[0:]
2015-01-29 11:31:33.985 MyApp[12631:273902] mvx:Diagnostic:287.17 Stack Trace = [ at Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadViewModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request, IMvxBundle savedState, IMvxViewModelLocator viewModelLocator) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadViewModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request, IMvxBundle savedState) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods.LoadViewModel (IMvxTouchView touchView) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Views.MvxViewExtensionMethods.OnViewCreate (IMvxView view, System.Func`1 viewModelLoader) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods.OnViewCreate (IMvxTouchView touchView) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerAdapter.HandleViewDidLoadCalled
[0:] mvx:Diagnostic:287.17 Stack Trace = [ at Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadViewModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request, IMvxBundle savedState, IMvxViewModelLocator viewModelLocator) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.ViewModels.MvxViewModelLoader.LoadViewModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request, IMvxBundle savedState) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods.LoadViewModel (IMvxTouchView touchView) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Views.MvxViewExtensionMethods.OnViewCreate (IMvxView view, System.Func`1 viewModelLoader) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods.OnViewCreate (IMvxTouchView touchView) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerAdapter.HandleViewDidLoadCalled (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
at (wrapper delegate-invoke) <Module>:invoke_void_object_EventArgs (object,System.EventArgs)
at Cirrious.CrossCore.Core.MvxDelegateExtensionMethods.Raise (System.EventHandler eventHandler, System.Object sender) [0x00000] in <filename unknown>:0
at Cirrious.CrossCore.Touch.Views.MvxEventSourceViewController.ViewDidLoad () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:62
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:46
at MyApp.iOS.Application.Main (System.String[] args) [0x00002] in c:\MyApp.iOS\Main.cs:21 ]
(System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
at (wrapper delegate-invoke) <Module>:invoke_void_object_EventArgs (object,System.EventArgs)
at Cirrious.CrossCore.Core.MvxDelegateExtensionMethods.Raise (System.EventHandler eventHandler, System.Object sender) [0x00000] in <filename unknown>:0
at Cirrious.CrossCore.Touch.Views.MvxEventSourceViewController.ViewDidLoad () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:62
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:46
at MyApp.iOS.Application.Main (System.String[] args) [0x00002] in c:\MyApp\
MyApp.iOS\Main.cs:21 ]
[0:]
2015-01-29 11:31:34.393 MyApp[12631:273902] mvx:Diagnostic:287.58 Inner Exception message = [Problem creating viewModel of type LogonViewModel]
[0:] mvx:Diagnostic:287.58 Inner Exception message = [Problem creating viewModel of type LogonViewModel]
You should name your viewcontroller in the storyboard LogonView and not LogonViewController. That's the viewType.Name that MvvmCross is looking for.
The problem was that a service injected into the LogonViewModel used the MvvmCross Messenger plugin. I had not added the plugin via nuget to the project. The exception that informed me of this was an inner exception of an inner exception. I should have dug deeper. Thanks again to you Stuart for this help and MvvmCross goodness in general. Thanks also to EShy for the naming help.
I'm trying to run samples for aspnet 5 on os x:
git clone https://github.com/shirhatti/Home.git
When I build the project HelloMvc -- 'kpm build' -- it's ok.
Then I run app using 'k kestrel' and see the following error:
Missing method Microsoft.Framework.Runtime.ILibraryInformation::get_LoadableAssemblies() in assembly data-0x7feb6aa02a00, referenced in assembly /Users/minya/.kpm/packages/Microsoft.AspNet.Mvc.Core/6.0.0-beta2-11905/lib/aspnet50/Microsoft.AspNet.Mvc.Core.dll
System.MissingMethodException: Method not found: 'Microsoft.Framework.Runtime.ILibraryInformation.get_LoadableAssemblies'.
at System.Linq.Enumerable+c__Iterator122[Microsoft.Framework.Runtime.ILibraryInformation,System.Reflection.AssemblyName].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator102[System.Reflection.AssemblyName,System.Reflection.Assembly].MoveNext () [0x00000] in :0
at System.Linq.Enumerable+c__Iterator122[System.Reflection.Assembly,System.Reflection.TypeInfo].MoveNext () [0x00000] in <filename unknown>:0
at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.BuildModel () [0x00000] in <filename unknown>:0
at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.GetDescriptors () [0x00000] in <filename unknown>:0
at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.Invoke (Microsoft.AspNet.Mvc.ActionDescriptorProviderContext context, System.Action callNext) [0x00000] in <filename unknown>:0
at Microsoft.Framework.DependencyInjection.NestedProviders.NestedProviderManager1+CallNext[Microsoft.AspNet.Mvc.ActionDescriptorProviderContext].CallNextProvider () [0x00000] in :0
at Microsoft.Framework.DependencyInjection.NestedProviders.NestedProviderManager1[Microsoft.AspNet.Mvc.ActionDescriptorProviderContext].Invoke (Microsoft.AspNet.Mvc.ActionDescriptorProviderContext context) [0x00000] in <filename unknown>:0
at Microsoft.AspNet.Mvc.DefaultActionDescriptorsCollectionProvider.GetCollection () [0x00000] in <filename unknown>:0
at Microsoft.AspNet.Mvc.DefaultActionDescriptorsCollectionProvider.get_ActionDescriptors () [0x00000] in <filename unknown>:0
at Microsoft.AspNet.Mvc.Routing.AttributeRouting.GetActionDescriptors (IServiceProvider services) [0x00000] in <filename unknown>:0
at Microsoft.AspNet.Mvc.Routing.AttributeRouting.CreateAttributeMegaRoute (IRouter target, IServiceProvider services) [0x00000] in <filename unknown>:0
at Microsoft.AspNet.Builder.BuilderExtensions.UseMvc (IApplicationBuilder app, System.Action1 configureRoutes) [0x00000] in :0
at Microsoft.AspNet.Builder.BuilderExtensions.UseMvc (IApplicationBuilder app) [0x00000] in :0
at KWebStartup.Startup.Configure (IApplicationBuilder app) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
There is no exact problem in google. I was tried to reinstall kvm, delete and checkout NuGet deps.
Updated:
Similar behavior on Windows when I try to run the same project by 'k web':
System.MissingMethodException: Method not found: 'System.Collections.Generic.IEnumerable1<System.Reflection.AssemblyName> Microsoft.Framework.Runtime.ILibraryInformation.g
et_LoadableAssemblies()'.
at Microsoft.AspNet.Mvc.DefaultAssemblyProvider.<>c__DisplayClass0.<get_CandidateAssemblies>b__1(ILibraryInformation l)
at System.Linq.Enumerable.<SelectManyIterator>d__142.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__142.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.BuildModel()
at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.GetDescriptors()
at Microsoft.AspNet.Mvc.ControllerActionDescriptorProvider.Invoke(ActionDescriptorProviderContext context, Action callNext)
at Microsoft.Framework.DependencyInjection.NestedProviders.NestedProviderManager1.CallNext.CallNextProvider()
at Microsoft.Framework.DependencyInjection.NestedProviders.NestedProviderManager1.Invoke(T context)
at Microsoft.AspNet.Mvc.DefaultActionDescriptorsCollectionProvider.GetCollection()
at Microsoft.AspNet.Mvc.DefaultActionDescriptorsCollectionProvider.get_ActionDescriptors()
at Microsoft.AspNet.Mvc.Routing.AttributeRouting.GetActionDescriptors(IServiceProvider services)
at Microsoft.AspNet.Mvc.Routing.AttributeRouting.CreateAttributeMegaRoute(IRouter target, IServiceProvider services)
at Microsoft.AspNet.Builder.BuilderExtensions.UseMvc(IApplicationBuilder app, Action1 configureRoutes)
at Microsoft.AspNet.Builder.BuilderExtensions.UseMvc(IApplicationBuilder app)
at HelloMvc.Startup.Configure(IApplicationBuilder app) in C:\prj\Home\samples\HelloMvc\Startup.cs:line 18
Seems to be the problem is in one (or more) of referenced in Microsoft.AspNet.Mvc.* assemblies. This is disassemble of DefaultAssemblyProvider from Microsoft.AspNet.Mvc.Core. I guess the problem is in ILibraryManager's implementations GetReferencingLibraries() method. But I can't find this implementation.
public class DefaultAssemblyProvider : IAssemblyProvider
{
private static readonly HashSet<string> _mvcAssemblyList;
private readonly ILibraryManager _libraryManager;
public IEnumerable<Assembly> CandidateAssemblies
{
get
{
return Enumerable.Select<AssemblyName, Assembly>(Enumerable.SelectMany<ILibraryInformation, AssemblyName>(this.GetCandidateLibraries(), DefaultAssemblyProvider.\u003C\u003Ec__DisplayClass0.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate2 ?? (DefaultAssemblyProvider.\u003C\u003Ec__DisplayClass0.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate2 = new Func<ILibraryInformation, IEnumerable<AssemblyName>>(DefaultAssemblyProvider.\u003C\u003Ec__DisplayClass0.CS\u0024\u003C\u003E9__inst.\u003Cget_CandidateAssemblies\u003Eb__1))), new Func<AssemblyName, Assembly>(DefaultAssemblyProvider.Load));
}
}
static DefaultAssemblyProvider()
{
HashSet<string> hashSet = new HashSet<string>((IEqualityComparer<string>) StringComparer.Ordinal);
string str1 = "Microsoft.AspNet.Mvc";
hashSet.Add(str1);
string str2 = "Microsoft.AspNet.Mvc.Core";
hashSet.Add(str2);
string str3 = "Microsoft.AspNet.Mvc.ModelBinding";
hashSet.Add(str3);
string str4 = "Microsoft.AspNet.Mvc.Razor";
hashSet.Add(str4);
string str5 = "Microsoft.AspNet.Mvc.Razor.Host";
hashSet.Add(str5);
string str6 = "Microsoft.AspNet.Mvc.Rendering";
hashSet.Add(str6);
DefaultAssemblyProvider._mvcAssemblyList = hashSet;
}
public DefaultAssemblyProvider(ILibraryManager libraryManager)
{
this._libraryManager = libraryManager;
}
internal IEnumerable<ILibraryInformation> GetCandidateLibraries()
{
return Enumerable.Where<ILibraryInformation>(Enumerable.Distinct<ILibraryInformation>(Enumerable.SelectMany<string, ILibraryInformation>((IEnumerable<string>) DefaultAssemblyProvider._mvcAssemblyList, new Func<string, IEnumerable<ILibraryInformation>>(this._libraryManager.GetReferencingLibraries))), new Func<ILibraryInformation, bool>(DefaultAssemblyProvider.IsCandidateLibrary));
}
private static Assembly Load(AssemblyName assemblyName)
{
return Assembly.Load(assemblyName);
}
private static bool IsCandidateLibrary(ILibraryInformation library)
{
return !DefaultAssemblyProvider._mvcAssemblyList.Contains(library.get_Name());
}
}
I had a similar problem on Windows and found the wrong KRE was active.
Executing kvm list shows a list of KRE. In my case the 1.0.0-alpha4 version was active instead of the more recent beta version.
Switching to the default with kvm use default sorted it out for me.
I was able to resolve this error by updating my version of KVM, there is probably a simpler way but, assuming you initially installed using homebrew, running these commands should solve your issue
brew untap aspnet/k
brew tap aspnet/k
brew install kvm
then you should be able to run k kestrel
if you get a message that kvm is already installed then:
brew link --overwrite mono
brew uninstall mono
brew reinstall kvm
I'm using WCF Data Services 5.6 in a PCL project with MVVMCross. In the WPF client the following code (in the viewModel) works like a charm (based on the sample found at http://msdn.microsoft.com/en-us/library/dd756367(v=vs.110).aspx):
DataServiceQuery<T> query = this.LoadItemsQuery;
query.BeginExecute((result) =>
{
try
{
DataServiceQuery<T> resultQuery = result.AsyncState as DataServiceQuery<T>;
foreach (T item in resultQuery.EndExecute(result))
{
// Do something here
}
}
catch (Exception ex)
{
PublishException(ex);
}
}
, query);
But in the Android client, "resultQuery.EndExecute(result)" throws the following exception:
System.InvalidOperationException: An error occurred while processing this request. ---> System.NotImplementedException: The requested feature is not implemented.
at System.Net.WebResponse.get_SupportsHeaders () [0x00000] in <filename unknown>:0
at System.Data.Services.Client.HttpWebRequestMessage.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.ODataRequestMessageWrapper.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.DataServiceContext.GetResponseHelper (System.Data.Services.Client.ODataRequestMessageWrapper request, IAsyncResult asyncResult, Boolean handleWebException) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.DataServiceContext.EndGetResponse (System.Data.Services.Client.ODataRequestMessageWrapper request, IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.RequestInfo.EndGetResponse (System.Data.Services.Client.ODataRequestMessageWrapper request, IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.QueryResult.AsyncEndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Data.Services.Client.BaseAsyncResult.EndExecute[QueryResult] (System.Object source, System.String method, IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Data.Services.Client.QueryResult.EndExecuteQuery[Appointment] (System.Object source, System.String method, IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 }
Any ideas? Has someone tested WCF Data Services 5.6 with MonoDroid?
Thanks in advance
https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/WebResponse.cs
You can see from the source code that it is indeed not implemented.
Mono's WCF support is not complete, so using it against WCF Data Services is risky.
If possible, use ASP.NET Web API instead of WCF at server side, and then on client side you get better support via HttpClient.
The bug is in HttpWebResponse.cs,which should add the following:
public override bool SupportsHeaders
{
get
{
return true;
}
}
Should work with the latest release : Mono for Android 4.12.3.I test and found it worked with Microsoft.Data.Service.Client.Portable.dll.
I use MvvmCross for develop a CrossPlatform App.
I work on my Mac and I have not errors when I build my solution.
When I run it... I have this error : failed to find constructor for type Cirrious.MvvmCross.ViewModels.MvxViewModelLoader and highlights base.ViewDidLoad();
Code :
public partial class MainView : MvxViewController
{
static bool UserInterfaceIdiomIsPhone {
get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; }
}
public MainView ()
: base (UserInterfaceIdiomIsPhone ? "MainView_iPhone" : "MainView_iPad", null)
{
}
public override void DidReceiveMemoryWarning ()
{
// Releases the view if it doesn't have a superview.
base.DidReceiveMemoryWarning ();
// Release any cached data, images, etc that aren't in use.
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// Perform any additional setup after loading the view, typically from a nib.
}
It's a default code, I just changed super-class (UIViewController to MvxViewController)
Stacktrace :
Failed to find constructor for type Cirrious.MvvmCross.ViewModels.MvxViewModelLoader
at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.IoCConstruct (System.Type type) [0x00000] in :0
at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer+ConstructingResolver.Resolve () [0x00000] in :0
at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.InternalTryResolve (System.Type type, ResolveOptions resolveOptions, System.Object& resolved) [0x00000] in :0
at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.InternalTryResolve (System.Type type, System.Object& resolved) [0x00000] in :0
at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.Resolve (System.Type t) [0x00000] in :0
at Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.Resolve[IMvxViewModelLoader] () [0x00000] in :0
at Cirrious.CrossCore.Mvx.Resolve[IMvxViewModelLoader] () [0x00000] in :0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods.LoadViewModel (IMvxTouchView touchView) [0x00000] in :0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods+<>c_DisplayClass1.b_0 () [0x00000] in :0
at Cirrious.MvvmCross.Views.MvxViewExtensionMethods.OnViewCreate (IMvxView view, System.Func`1 viewModelLoader) [0x00000] in :0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerExtensionMethods.OnViewCreate (IMvxTouchView touchView) [0x00000] in :0
at Cirrious.MvvmCross.Touch.Views.MvxViewControllerAdapter.HandleViewDidLoadCalled (System.Object sender, System.EventArgs e) [0x00000] in :0
at (wrapper delegate-invoke) :invoke_void_this__object_EventArgs (object,System.EventArgs)
at Cirrious.CrossCore.Core.MvxDelegateExtensionMethods.Raise (System.EventHandler eventHandler, System.Object sender) [0x00000] in :0
at Cirrious.CrossCore.Touch.Views.MvxEventSourceViewController.ViewDidLoad () [0x00000] in :0
at TrainingCatalog.Touch.MainView.ViewDidLoad () [0x00002] in /Users/a_masteruser/Projects/DefaultCollection/_git/HapplyTrainingCatalog/TrainingCatalog.Touch/Views/MainView.cs:30
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging:void_objc_msgSend (intptr,intptr)
at MonoTouch.UIKit.UIWindow.MakeKeyAndVisible () [0x00008] in /Developer/MonoTouch/Source/monotouch/src/UIKit/.pp-UIWindow.g.cs:129
at TrainingCatalog.Touch.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication app, MonoTouch.Foundation.NSDictionary options) [0x0003c] in /Users/a_masteruser/Projects/DefaultCollection/_git/HapplyTrainingCatalog/TrainingCatalog.Touch/AppDelegate.cs:21
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/.pp-UIApplication.cs:38
at TrainingCatalog.Touch.Application.Main (System.String[] args) [0x00008] in /Users/a_masteruser/Projects/DefaultCollection/_git/HapplyTrainingCatalog/TrainingCatalog.Touch/Main.cs:17
Failed to find constructor for type Cirrious.MvvmCross.ViewModels.MvxViewModelLoader
From the stack trace, I'm guessing the line that is failing is: https://github.com/MvvmCross/MvvmCross/blob/v3.1/Cirrious/Cirrious.MvvmCross.Touch/Views/MvxViewControllerExtensionMethods.cs#L44
This is looking in IoC for a type which has been registered in setup as:
protected virtual void InitializeViewModelFramework()
{
Mvx.RegisterType<IMvxViewModelLoader, MvxViewModelLoader>();
}
(from https://github.com/MvvmCross/MvvmCross/blob/v3.1/Cirrious/Cirrious.MvvmCross/Platform/MvxSetup.cs#L192)
Looking at MvxViewModelLoader, this is defined in: https://github.com/MvvmCross/MvvmCross/blob/v3.1/Cirrious/Cirrious.MvvmCross/ViewModels/MvxViewModelLoader.cs - so it should have a default public parameterless constructor added by the compiler...
With this in mind...
I'm guessing that maybe Xamarin is stripping out the constructor from your deployed binaries. This might be because of your linker settings - so please check that you have set the linker to link "SDK only". But if that doesn't help then this might be down to some Xamarin optimisation/feature - so you might need to .
As a simple workaround you could try overriding Setup so that you use:
protected override void InitializeViewModelFramework()
{
Mvx.RegisterSingleton<IMvxViewModelLoader>(() => new MvxViewModelLoader>());
}
However, even if this works, then I'd be worried that the linker might be stripping out other symbols in your app - so this might not be enough... you might need to chase this through with Xamarin.