I have the following problem when using fragments in mvvmCross. I borrowed the code from https://github.com/slodge/MvvmCross-Tutorials/tree/master/Fragments. The Framepresenter Class which is in https://github.com/slodge/MvvmCross-Tutorials/blob/master/Fragments/FragmentSample.UI.Droid/Setup.cs resolved requests to show viewmodels in the show method
public class CustomPresenter
: MvxAndroidViewPresenter
, ICustomPresenter
{
private Dictionary _dictionary = new Dictionary();
public override void Show(MvxViewModelRequest request)
{
IFragmentHost host;
if (_dictionary.TryGetValue(request.ViewModelType, out host))
{
if (host.Show(request))
{
return;
}
}
base.Show(request);
}
...
In the first run all works well. If I close the app with the "Back" Button of android and open it again I will get a null pointer exception in the Show method of the base class (MvxAndroidViewPresenter). This is because the top level activity does not exist any more. The property Activity in MvxAndroidViewPresenter is returning null. How can I recreate the top level activity when restarting the app?
I get the following exception
06-26 16:06:28.102 I/MonoDroid( 6791): UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.Droid.Views.MvxAndroidViewPresenter.Show (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest) [0x0000f] in d:\Projekte\MvvmCross\mvvmcross-20130621\Cirrious\Cirrious.MvvmCross.Droid\Views\MvxAndroidViewPresenter.cs:29
06-26 16:06:28.102 I/MonoDroid( 6791): at ManCockpit.UI.Droid.CockpitFragmentPresenter.Show (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest) [0x00040] in d:\Projekte\ManCockpitV2\ManCockpit.UI.Droid\CockpitFragmentPresenter.cs:41
06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.Droid.Views.MvxAndroidViewDispatcher/c__DisplayClass1.b__0 () [0x00000] in d:\Projekte\MvvmCross\mvvmcross-20130621\Cirrious\Cirrious.MvvmCross.Droid\Views\MvxAndroidViewDispatcher.cs:27
06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.Droid.Views.MvxAndroidViewDispatcher.ShowViewModel (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest) [0x00015] in d:\Projekte\MvvmCross\mvvmcross-20130621\Cirrious\Cirrious.MvvmCross.Droid\Views\MvxAndroidViewDispatcher.cs:27
06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.ViewModels.MvxNavigatingObject.ShowViewModelImpl (System.Type,Cirrious.MvvmCross.ViewModels.IMvxBundle,Cirrious.MvvmCross.ViewModels.IMvxBundle,Cirrious.MvvmCross.ViewModels.MvxRequestedBy)
06-26 16:06:28.102 I/MonoDroid( 6791): at (wrapper dynamic-method) objec06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.ViewModels.MvxNavigatingObject.ShowViewModel (System.Type,Cirrious.MvvmCross.ViewModels.IMvxBundle,Cirrious.MvvmCross.ViewModels.IMvxBundle,Cirrious.MvvmCross.ViewModels.MvxRequestedBy)
06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.ViewModels.MvxNavigatingObject.ShowViewModel (Cirrious.MvvmCross.ViewModels.IMvxBundle,Cirrious.MvvmCross.ViewModels.MvxBundle,Cirrious.MvvmCross.ViewModels.MvxRequestedBy)
06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.ViewModels.MvxAppStart`1.Start (object)
06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.Droid.Views.MvxSplashScreenActivity.TriggerFirstNavigate () [0x00007] in d:\Projekte\MvvmCross\mvvmcross-20130621\Cirrious\Cirrious.MvvmCross.Droid\Views\MvxSplashScreenActivity.cs:82
06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.Droid.Views.MvxSplashScreenActivity.InitializationComplete () [0x00001] in d:\Projekte\MvvmCross\mvvmcross-20130621\Cirrious\Cirrious.MvvmCross.Droid\Views\MvxSplashScreenActivity.cs:76
06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.Droid.Platform.MvxAndroidSetupSingleton.InitialiseFromSplashScreen (Cirrious.MvvmCross.Droid.Views.IMvxAndroidSplashScreenActivity) [0x00036] in d:\Projekte\MvvmCross\mvvmcross-20130621\Cirrious\Cirrious.MvvmCross.Droid\Platform\MvxAndroidSetupSingleton.cs:76
06-26 16:06:28.102 I/MonoDroid( 6791): at Cirrious.MvvmCross.Droid.Views.MvxSplashScreenActivity.OnCreate (Android.OS.Bundle) [0x00014] in d:\Projekte\MvvmCross\mvvmcross-20130621\Cirrious\Cirrious.MvvmCross.Droid\Views\MvxSplashScreenActivity.cs:47
06-26 16:06:28.102 I/MonoDroid( 6791): at ManCockpit.UI.Droid.SplashScreenActivity.OnCreate (Android.OS.Bundle) [0x0002e] in d:\Projekte\ManCockpitV2\ManCockpit.UI.Droid\SplashScreenActivity.cs:105
06-26 16:06:28.102 I/MonoDroid( 6791): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-lion-bs1/0cc7ae3b/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.App.Activity.cs:1859
06-26 16:06:28.102 I/MonoDroid( 6791): at (wrapper dynamic-method) object.08473369-0d89-4344-a57c-40e97793bab8 (intptr,intptr,intptr)
This looks like this is nothing to do with Fragments - but is instead a known error - https://github.com/slodge/MvvmCross/issues/316
The fix for this hasn't yet been released to nuget.
To workaround it, you can either build the fix yourself. Or you can override the behaviour in your splashscreen class by adding:
private bool _isResumed;
protected override void OnResume()
{
_isResumed = true;
base.OnResume();
}
protected override void OnPause()
{
_isResumed = false;
base.OnPause();
}
public override void InitializationComplete()
{
if (!_isResumed)
return;
TriggerFirstNavigate();
}
Related
After repeating visiting screen, I get next error:
System.ObjectDisposedException: Cannot access a disposed object. at
Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable
self) [0x00029] in <286213b9e14c442ba8d8d94cc9dbec8e>:0 07-03
11:29:51.230 I/MonoDroid(20631): at
Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod
(System.String encodedMember, Java.Interop.IJavaPeerable self,
Java.Interop.JniArgumentValue* parameters) [0x00000] in
<286213b9e14c442ba8d8d94cc9dbec8e>:0 07-03 11:29:51.230
I/MonoDroid(20631): at Android.Views.View.set_Enabled
(System.Boolean value) [0x00022] in
:0 07-03 11:29:51.230
I/MonoDroid(20631): at
MvvmCross.Platforms.Android.Binding.Target.MvxViewClickBinding.RefreshEnabledState
() [0x00022] in
C:\projects\mvvmcross\MvvmCross\Platforms\Android\Binding\Target\MvxViewClickBinding.cs:64
07-03 11:29:51.230 I/MonoDroid(20631): at
MvvmCross.Platforms.Android.Binding.Target.MvxViewClickBinding.OnCanExecuteChanged
(System.Object sender, System.EventArgs e) [0x00000] in
C:\projects\mvvmcross\MvvmCross\Platforms\Android\Binding\Target\MvxViewClickBinding.cs:69
07-03 11:29:51.230 I/MonoDroid(20631): at (wrapper
managed-to-native)
System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
07-03 11:29:51.230 I/MonoDroid(20631): at
System.Reflection.MonoMethod.Invoke (System.Object obj,
System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder
binder, System.Object[] parameters, System.Globalization.CultureInfo
culture) [0x0003b] in :0 07-03
11:29:51.230 I/MonoDroid(20631): --- End of inner exception stack
trace --- 07-03 11:29:51.230 I/MonoDroid(20631): at
System.Reflection.MonoMethod.Invoke (System.Object obj,
System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder
binder, System.Object[] parameters, System.Globalization.CultureInfo
culture) [0x00054] in :0 07-03
11:29:51.230 I/MonoDroid(20631): at
System.Reflection.MethodBase.Invoke (System.Object obj,
System.Object[] parameters) [0x00000] in
:0 07-03 11:29:51.230
I/MonoDroid(20631): at
MvvmCross.WeakSubscription.MvxWeakEventSubscription`2[TSource,TEventArgs].OnSourceEvent
(System.Object sender, TEventArgs e) [0x0000a] in
C:\projects\mvvmcross\MvvmCross\WeakSubscription\MvxWeakEventSubscription.cs:74
07-03 11:29:51.230 I/MonoDroid(20631): at
MvvmCross.Commands.MvxWeakCommandHelper.RaiseCanExecuteChanged
(System.Object sender) [0x00014] in
C:\projects\mvvmcross\MvvmCross\Commands\MvxCommand.cs:96 07-03
11:29:51.230 I/MonoDroid(20631): at
MvvmCross.Commands.MvxCommandBase.b__9_0 ()
[0x00000] in
C:\projects\mvvmcross\MvvmCross\Commands\MvxCommand.cs:135
Not sure, if this android or mvvmcross issue. Can I avoid invoking view in MvxViewClickBinding, if it disposed?
I guess you could write a static extension method for Java.Lang.Object like below:
public static class ObjectExtensions
{
public static bool IsDisposedOrNull(this Object objectValue)
{
return objectValue?.Handle == IntPtr.Zero;
}
}
I can't send a lot of data (json with byte array inside) from xamarin ios single view app to server ASP .NET.
My models (same on ios app and server)
public class VirtualTourDataModel
{
public string VTName { get; set; }
public List<ViewPoint> ViewPoints { get; set; }
}
public class ViewPoint
{
public string PointName { get; set; }
public byte[] Video { get; set; }
public List<bool> Connections { get; set; }
}
how i set bytearray:
ViewPoint viewPoint = new ViewPoint();
viewPoint.Video = ToByteArray(NSData.FromUrl(outputFileUrl));
VirtualTourData.ViewPoints.Add(viewPoint);
public static byte[] ToByteArray(NSData data)
{
var bytes = new byte[data.Length];
System.Runtime.InteropServices.Marshal.Copy(data.Bytes, bytes, 0, Convert.ToInt32(data.Length));
return bytes;
}
How do i send data:
VirtualTourDataModel vtModel = new VirtualTourDataModel();
vtModel.VTName = VirtualTourData.VTName;
vtModel.ViewPoints = VirtualTourData.ViewPoints;
var json = JsonConvert.SerializeObject(vtModel);
string sUrl = "http://192.168.0.56:6240/api/UploadVT/Upload";
try
{
using (var httpClient = new HttpClient())
{
httpClient.Timeout = TimeSpan.FromMinutes(1);
httpClient.BaseAddress = new Uri("http://192.168.0.56:6240");
var content = new StringContent(json, Encoding.UTF8, "application/json");
var url = new Uri(string.Concat("http://192.168.0.56:6240", "/api/UploadVT/Upload"));
HttpResponseMessage response = await httpClient.PostAsync(url, content);
if (response.IsSuccessStatusCode)
{
// this result string should be something like: "{"token":"rgh2ghgdsfds"}"
var result = await response.Content.ReadAsStringAsync();
}
}
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
I receive this error in catch:
{System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
at System.Net.WebConnectionStream.EndWrite (System.IAsyncResult r) [0x000b9] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/System/System.Net/WebConnectionStream.cs:617
at System.IO.Stream+<>c.b__53_1 (System.IO.Stream stream, System.IAsyncResult asyncResult) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/io/stream.cs:729
at System.Threading.Tasks.TaskFactory1+FromAsyncTrimPromise1[TResult,TInstance].Complete (TInstance thisRef, System.Func3[T1,T2,TResult] endMethod, System.IAsyncResult asyncResult, System.Boolean requiresSynchronization) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs:1441
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:447
at System.Net.Http.HttpClientHandler+<SendAsync>d__63.MoveNext () [0x00324] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:379
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0
at System.Net.Http.HttpClient+d__48.MoveNext () [0x00080] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs:276
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in :0
at EasyVTApp.VTLinkViewController+d__2.MoveNext () [0x00107] in D:\magistr\EasyVTApp\EasyVTApp\VTLinkViewController.cs:79 }
I've writed for my Xamarin application a couple of CustomDatePickerRenderer for Android and iOS. For Android all works fine, for iOS no. I've when create the DatePicker Control an exception for an invalid cast.
Here the code(simplyfied):
Xamarin interface
class CustomDatePicker : Xamarin.Forms.DatePicker
{
}
iOS Renderer
class CustomDatePickerRenderer : DatePickerRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<DatePicker> e)
{
base.OnElementChanged(e);
}
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (Control == null)
{
return;
}
}
}
Exception
System.InvalidCastException: Specified cast is not valid.
at (wrapper castclass) System.Object:__castclass_with_cache (object,intptr,intptr)
at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in <4cf9e9e173a04ea3aa841c775e6a23d7>:0
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001b] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\Platform.cs:192
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x00009] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:63
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:36
at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000cc] in <4cf9e9e173a04ea3aa841c775e6a23d7>:0
at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in <4cf9e9e173a04ea3aa841c775e6a23d7>:0
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001b] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\Platform.cs:192
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x00009] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:63
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:36
at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000cc] in <4cf9e9e173a04ea3aa841c775e6a23d7>:0
at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in <4cf9e9e173a04ea3aa841c775e6a23d7>:0
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001b] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\Platform.cs:192
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x00009] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:63
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x0000f] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:113
at Xamarin.Forms.Element.OnChildAdded (Xamarin.Forms.Element child) [0x00029] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Element.cs:354
at Xamarin.Forms.VisualElement.OnChildAdded (Xamarin.Forms.Element child) [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\VisualElement.cs:570
at Xamarin.Forms.Layout`1[T].OnChildAdded (Xamarin.Forms.Element child) [0x00000] in <051840eae40a4636884ee6bc6a0d140a>:0
at Xamarin.Forms.Layout.OnInternalAdded (Xamarin.Forms.View view) [0x0001d] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:406
at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00089] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:396
at (wrapper delegate-invoke) <Module>:invoke_void_object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00012] in <c3954baf21fc42d6b4b50ba067398247>:0
at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <c3954baf21fc42d6b4b50ba067398247>:0
at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x00024] in <c3954baf21fc42d6b4b50ba067398247>:0
at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00023] in <15e850188d9f425bbeae90f0bbc51e17>:0
at Xamarin.Forms.ObservableWrapper`2[TTrack,TRestrict].Add (TRestrict item) [0x0004b] in <051840eae40a4636884ee6bc6a0d140a>:0
at Xamarin.Forms.RelativeLayout+RelativeElementCollection.Add (Xamarin.Forms.View view, Xamarin.Forms.Constraint xConstraint, Xamarin.Forms.Constraint yConstraint, Xamarin.Forms.Constraint widthConstraint, Xamarin.Forms.Constraint heightConstraint) [0x00012] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\RelativeLayout.cs:313
at ArgonApp.InserimentoAutoletturaPage+<selectPage>c__async3.MoveNext () [0x00241] in /Users/alessandro/Desktop/Argon Whitelabel/ArgonApp/ArgonApp/Views/InserimentoAutoletturaPage.xaml.cs:406
Have you any idea on this problem?
Thanks.
I have upgraded a site from EPiServer CMS 6 R2 to 7.5 via Deployment Center. After running the "Upgrade/disable Add-ons After Product Upgrade" I cannot access the back-end/admin page.
Error:
Exception details:
ActivationException: Activation error occurred while trying to get instance of type EPiDashboardController, key ""
Stack trace:
[ActivationException: Activation error occurred while trying to get instance of type EPiDashboardController, key ""]
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
at EPiServer.Shell.Web.Mvc.ModuleControllerFactory.CreateController(RequestContext requestContext, String controllerName)
at EPiServer.Shell.Web.Mvc.ModuleMvcHandler.ProcessRequestInit(HttpContextBase httpContext)
at EPiServer.Shell.Web.Mvc.ModuleMvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
[Inner exception StructureMapException: StructureMap Exception Code: 207
Internal exception while creating Instance '0512faec-bb98-447c-a311-5bde00402363' of PluginType EPiServer.Shell.ViewComposition.IViewManager. Check the inner exception for more details.]
at StructureMap.Pipeline.ConstructorInstance.Build(Type pluginType, BuildSession session, IInstanceBuilder builder)
at StructureMap.Pipeline.Instance.createRawObject(Type pluginType, BuildSession session)
at StructureMap.Pipeline.Instance.Build(Type pluginType, BuildSession session)
at StructureMap.Pipeline.ObjectBuilder.Resolve(Type pluginType, Instance instance, BuildSession session)
at StructureMap.BuildSession.CreateInstance(Type pluginType, Instance instance)
at StructureMap.BuildSession.CreateInstance(Type pluginType)
at StructureMap.Pipeline.Instance.createRawObject(Type pluginType, BuildSession session)
at StructureMap.Pipeline.Instance.Build(Type pluginType, BuildSession session)
at StructureMap.Pipeline.ConstructorInstance.Get[T](String propertyName, BuildSession session)
at lambda_method(Closure , IArguments )
at StructureMap.Construction.BuilderCompiler.FuncCompiler`1.<>c__DisplayClass2.b__0(IArguments args)
at StructureMap.Construction.InstanceBuilder.BuildInstance(IArguments args)
at StructureMap.Pipeline.ConstructorInstance.Build(Type pluginType, BuildSession session, IInstanceBuilder builder)
at StructureMap.Pipeline.SmartInstance`1.build(Type pluginType, BuildSession session)
at StructureMap.Pipeline.Instance.createRawObject(Type pluginType, BuildSession session)
at StructureMap.Pipeline.Instance.Build(Type pluginType, BuildSession session)
at StructureMap.Pipeline.ObjectBuilder.Resolve(Type pluginType, Instance instance, BuildSession session)
at StructureMap.BuildSession.CreateInstance(Type pluginType, Instance instance)
at StructureMap.BuildSession.CreateInstance(Type pluginType)
at StructureMap.Pipeline.Instance.createRawObject(Type pluginType, BuildSession session)
at StructureMap.Pipeline.Instance.Build(Type pluginType, BuildSession session)
at StructureMap.Pipeline.ConstructorInstance.Get[T](String propertyName, BuildSession session)
at lambda_method(Closure , IArguments )
at StructureMap.Construction.BuilderCompiler.FuncCompiler`1.<>c__DisplayClass2.b__0(IArguments args)
at StructureMap.Construction.InstanceBuilder.BuildInstance(IArguments args)
at StructureMap.Pipeline.ConstructorInstance.Build(Type pluginType, BuildSession session, IInstanceBuilder builder)
at StructureMap.Pipeline.Instance.createRawObject(Type pluginType, BuildSession session)
at StructureMap.Pipeline.Instance.Build(Type pluginType, BuildSession session)
at StructureMap.Pipeline.ObjectBuilder.Resolve(Type pluginType, Instance instance, BuildSession session)
at StructureMap.BuildSession.CreateInstance(Type pluginType, Instance instance)
at StructureMap.BuildSession.CreateInstance(Type pluginType)
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
Thanks in advance,
Problem is solved by giving folder permissions to IIS_IUSRS
I am trying to add a header and footer to an MvxListView by using my own custom MvxAdapter.
From an Activity, I can just add the adapter to the listview in the OnCreate() method, and it just works.
But if I try to do the same from the OnCreateView() in a Fragment I get a Java.Lang.RuntimeException with the following stack trace:
at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod) [0x00000] in <filename unknown>:0
at Android.Widget.BaseAdapter.NotifyDataSetChanged () [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.NotifyDataSetChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Binding.Droid.Views.MvxAdapter.OnItemsSourceCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>: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 <filename unknown>:0
--- End of managed exception stack trace ---
java.lang.NullPointerException
at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)
Am I missing something here?
Thanks!