I am using EMDK for xamarin in an Xamarain.Android app. I am getting this error:
Unable to activate instance of type Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerImplementor from native handle 0x1d200001 (key_handle 0x426eae90).
This error occurs randomly.
Find below the detailed logs. Please help in resolving this issue
System.NotSupportedException: Unable to activate instance of type Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerImplementor from native handle 0x1d200001 (key_handle 0x41b8ad20). ---> System.MissingMethodException: No constructor found for Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerImplementor::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
at Java.Lang.Error: Exception of type 'Java.Lang.Error' was thrown.
at --- End of managed Java.Lang.Error stack trace ---
at java.lang.Error: Java callstack:
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.n_onStatus(Native Method)
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.onStatus(Scanner_StatusListenerImplementor.java:30)
at at com.symbol.emdk.barcode.StatusCallbackInternal$StatusCallbackThread.run(StatusCallbackInternal.java:73)
at --- End of managed Java.Lang.Error stack trace ---
at java.lang.Error: Java callstack:
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.n_onStatus(Native Method)
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.onStatus(Scanner_StatusListenerImplementor.java:30)
at at com.symbol.emdk.barcode.StatusCallbackInternal$StatusCallbackThread.run(StatusCallbackInternal.java:73)
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateProxy (System.Type type, IntPtr handle, JniHandleOwnership transfer) [0x00058] in <filename unknown>:0
at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x00138] in <filename unknown>:0
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x001b0] in <filename unknown>:0
at Java.Lang.Object.GetObject (IntPtr handle, JniHandleOwnership transfer, System.Type type) [0x000e5] in <filename unknown>:0
at Java.Lang.Object._GetObject[T] (IntPtr handle, JniHandleOwnership transfer) [0x0001a] in <filename unknown>:0
at Java.Lang.Object.GetObject[T] (IntPtr handle, JniHandleOwnership transfer) [0x00000] in <filename unknown>:0
at Java.Lang.Object.GetObject[T] (IntPtr jnienv, IntPtr handle, JniHandleOwnership transfer) [0x00006] in <filename unknown>:0
at Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerInvoker.n_OnStatus_Lcom_symbol_emdk_barcode_StatusData_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) [0x00000] in <filename unknown>:0
at at (wrapper dynamic-method) System.Object:043283ed-110f-43b7-811b-51b1dfa39e65 (intptr,intptr,intptr)
Just adding this in case someone may stumble onto it in the future
Not sure why are you getting that error, but here's a code sample that works without having to add an implementation of the IStatusListenerImplementor interface.
private void SetupEmdkBarcodeScanner
{
var emdkBarcodeManager = (Symbol.XamarinEMDK.Barcode.BarcodeManager)emdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Barcode);
var emdkBarcodeScanner = emdkBarcodeManager.GetDevice(BarcodeManager.DeviceIdentifier.Default);
if(emdkBarcodeScanner.IsReadPending)
{
emdkBarcodeScanner.CancelRead();
}
emdkBarcodeScanner.Data += HandleReadEvent;
emdkBarcodeScanner.Status += HandleStatusEvent;
}
private void HandleStatusEvent(object sender, Scanner.StatusEventArgs e)
{
if (e.P0.State != StatusData.ScannerStates.Idle)
{
return;
}
lock (concurrentReadsLock)
{
Thread.Sleep(100);
if (scanner.IsReadPending)
{
return;
}
emdkBarcodeScanner.Read();
}
}
private void HandleReadEvent(object sender, Scanner.DataEventArgs e)
{
if (e.P0.Result != ScannerResults.Success)
{
return
}
foreach (ScanDataCollection.ScanData data in e.P0.GetScanData())
{
string aimBarcodeData = data.Data; //here is your scanned barcode (e.g.: "]E00123456789123"
//... your barcode processing code goes here //
}
}
Also, don't forget to dispose at the end:
emdkBarcodeScanner.CancelRead();
emdkBarcodeScanner.Disable();
//.. unsubscribe the event handlers
emdkBarcodeScanner.Dispose();
//...and finally release the EMDK to remove your application's exclusive access.
emdkBarcodeManager.Release(EMDKManager.FEATURE_TYPE.Barcode);
Related
I use ABP 5.1.0
.Net Core,
I have my class
ItemAsyncEventBaseHandler : IAsyncEventHandler<TEvent>, ITransientDependency
where TEvent : EventData {…}
Then i have class:
CustomHandler: ItemAsyncEventBaseHandler<EventData>
{
public CustomHandler(
IUnitOfWorkManager unitOfWorkManager,
ISettingManager settingManager)
{
_unitOfWorkManager = unitOfWorkManager;
_settingManager = settingManager;
}
}
public override async Task HandleInternallyAsync(ItemUpdatedEvent eventData)
{
await _settingManager.ChangeSettingForApplicationAsync("key", value.ToString());
}
At first glance, this works, but if I run the handler on two different items in quick succession, I get an error:
(On some machines it is enough to run the event on two items, on others it is necessary to run the event on the other two items in order for the same error to occur.)
System.ObjectDisposedException: Cannot access a disposed object. A common cause of this error is disposing a context that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling Dispose() on the context, or wrapping the context in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
Object name: 'MyDbContext'.
at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed()
at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
at Microsoft.EntityFrameworkCore.DbContext.Set[TEntity]()
at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase`3.GetQueryable()
at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase`3.GetAllIncluding(Expression`1[] propertySelectors)
at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase`3.FirstOrDefaultAsync(Expression`1 predicate)
at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult[T](Task`1 actualReturnValue, Func`1 postAction, Action`1 finalAction)
at Abp.Configuration.SettingStore.GetSettingOrNullAsync(Nullable`1 tenantId, Nullable`1 userId, String name)
at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult[T](Task`1 actualReturnValue, Func`1 postAction, Action`1 finalAction)
at Abp.Configuration.SettingManager.InsertOrUpdateOrDeleteSettingValueAsync(String name, String value, Nullable`1 tenantId, Nullable`1 userId)
at Abp.Configuration.SettingManager.ChangeSettingForApplicationAsync(String name, String value)
at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinally(Task actualReturnValue, Func`1 postAction, Action`1 finalAction)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
And the value in the application settings is not updated.
I tried wrapping in uow but it doesn't help:
public override async Task HandleInternallyAsync(ItemUpdatedEvent eventData)
{
using (var uow = _unitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
{
await _settingManager.ChangeSettingForApplicationAsync("key", value.ToString());
await uow.CompleteAsync();
}
}
Sqlite crashes on SqliteConnecion
I have an application that uses Sqlite. I has been working perfectly for a couple of year.
I'm using Nuget System.Data.SQLite.Core 1.0.113.7
I tried to run it and i get this exception.
System.AccessViolationException HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an
indication that other memory is corrupt. Source= StackTrace:
The exception occurs in the
public static string DbFile
{
get { return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Foo\\Bar" + "\\Order.db"; }
}
public static SQLiteConnection OrderDbConnection()
{
try
{
var db = $"Data Source={DbFile};Version=3;";
return new SQLiteConnection(db);
}
catch (Exception ex)
{
var m = ex.Message;
throw;
}
}
on the line return new SQLiteConnection(db);
I'm using
Visual Studio 2017 version 15.9.35
.NET Framework 4.7.2
Edition Windows 10 Pro
Version 20H2
Installed on 2020-11-05
OS build 19042.928
Experience Windows Feature Experience Pack 120.2212.551.0
I just tried the application on windows 10 version 1909 and there it works!
Has anyone any idea on what could be wrong?
EDIT: Add Exception from Event Viewer
Application: DCMatrix.exe Framework Version: v4.0.30319 Description:
The process was terminated due to an unhandled exception. Exception
Info: System.AccessViolationException at
System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(System.Data.SQLite.SQLiteConfigOpsEnum)
at System.Data.SQLite.SQLite3.StaticIsInitialized() at
System.Data.SQLite.SQLiteLog.Initialize(System.String) at
System.Data.SQLite.SQLiteConnection..ctor(System.String, Boolean)
at System.Data.SQLite.SQLiteConnection..ctor(System.String) at
AbortedOrderDatabase.SqLiteBaseRepository.OrderDbConnection() at
AbortedOrderDatabase.SqLiteOrderRepository.IsOrderDone(System.String)
at DCMatrix.Workflow.IsOrderDone(System.String) at
DCMatrix.Workflow.GetOrder(System.String, Boolean ByRef, Boolean
ByRef) at DCMatrix.ViewMainWindow.DoLoadDataCommand() at
DCMatrix.ViewMainWindow.<get_LoadDataCommand>b__21_1(System.Object)
at DCMatrix.RelayCommand.Execute(System.Object) at
System.Windows.Input.CommandManager.TranslateInput(System.Windows.IInputElement,
System.Windows.Input.InputEventArgs) at
System.Windows.UIElement.OnKeyDownThunk(System.Object,
System.Windows.Input.KeyEventArgs) at
System.Windows.Input.KeyEventArgs.InvokeEventHandler(System.Delegate,
System.Object) at
System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate,
System.Object) at
System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object,
System.Windows.RoutedEventArgs) at
System.Windows.EventRoute.InvokeHandlersImpl(System.Object,
System.Windows.RoutedEventArgs, Boolean) at
System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject,
System.Windows.RoutedEventArgs) at
System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs,
Boolean) at System.Windows.Input.InputManager.ProcessStagingArea()
at
System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
at
System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
at
System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr,
System.Windows.Input.InputMode, Int32,
System.Windows.Input.RawKeyboardActions, Int32, Boolean, Boolean,
Int32) at
System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(System.Windows.Interop.MSG
ByRef, Boolean ByRef) at
System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(System.Windows.Interop.MSG
ByRef, System.Windows.Input.ModifierKeys) at
System.Windows.Interop.HwndSource.OnPreprocessMessage(System.Object)
at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,
System.Object, Int32) at
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object,
System.Delegate, System.Object, Int32, System.Delegate) at
System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority,
System.TimeSpan, System.Delegate, System.Object, Int32) at
System.Windows.Threading.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority,
System.Delegate, System.Object) at
System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(System.Windows.Interop.MSG
ByRef, Boolean ByRef) at
System.Windows.Interop.HwndSource+WeakEventPreprocessMessage.OnPreprocessMessage(System.Windows.Interop.MSG
ByRef, Boolean ByRef) at
System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(System.Windows.Interop.MSG
ByRef) at
System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at
System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object) at
System.Windows.Application.RunInternal(System.Windows.Window) at
System.Windows.Application.Run(System.Windows.Window) at
System.Windows.Application.Run() at DCMatrix.App.Main()
EDIT 2 Exception and Stack Trace
System.AccessViolationException HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an
indication that other memory is corrupt. Source= StackTrace:
" at
System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum
op) at System.Data.SQLite.SQLite3.StaticIsInitialized() at
System.Data.SQLite.SQLiteLog.Initialize(String className) at
System.Data.SQLite.SQLiteConnection..ctor(String connectionString,
Boolean parseViaFramework) at
System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
at AbortedOrderDatabase.SqLiteBaseRepository.OrderDbConnection() in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\OrderDatabase\SqLiteBaseRepository.cs:line 23"
EDIT 3 Enabled Native Code Debugging
Exception thrown at 0x776388E3 (ntdll.dll) in DCMatrix.exe:
0xC0000005: Access violation writing location 0x0044005C. occurred
System.AccessViolationException HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an
indication that other memory is corrupt. Source= StackTrace:
" at
System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum
op) at System.Data.SQLite.SQLite3.StaticIsInitialized() at
System.Data.SQLite.SQLiteLog.Initialize(String className) at
System.Data.SQLite.SQLiteConnection..ctor(String connectionString,
Boolean parseViaFramework) at
System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
at AbortedOrderDatabase.SqLiteBaseRepository.OrderDbConnection() in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\OrderDatabase\SqLiteBaseRepository.cs:line 23 at
AbortedOrderDatabase.SqLiteOrderRepository.IsOrderDone(String mo) in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\OrderDatabase\SqLiteOrderRepository.cs:line 57 at
DCMatrix.Workflow.IsOrderDone(String mo) in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\DCMarker\Workflow.cs:line 977 at
DCMatrix.Workflow.GetOrder(String tvnr, Boolean& isAbortedOrder,
Boolean& isOrderDone) in E:\Users\ame\source\repos\Seco
Tools\DCMatrix\DCMarker\Workflow.cs:line 920 at
DCMatrix.ViewMainWindow.DoLoadDataCommand() in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\DCMarker\CommandMainWindow.cs:line 244 at
DCMatrix.ViewMainWindow.<get_LoadDataCommand>b__21_1(Object p) in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\DCMarker\CommandMainWindow.cs:line 122 at
DCMatrix.RelayCommand.Execute(Object parameter) in
E:\Users\ame\source\repos\Seco
Tools\DCMatrix\DCMarker\RelayCommand.cs:line 34 at
System.Windows.Input.CommandManager.TranslateInput(IInputElement
targetElement, InputEventArgs inputEventArgs) at
System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate
genericHandler, Object genericTarget) at
System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object
target) at
System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target,
RoutedEventArgs routedEventArgs) at
System.Windows.EventRoute.InvokeHandlersImpl(Object source,
RoutedEventArgs args, Boolean reRaised) at
System.Windows.UIElement.RaiseEventImpl(DependencyObject sender,
RoutedEventArgs args) at
System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at
System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean
trusted) at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs
input) at
System.Windows.Input.InputProviderSite.ReportInput(InputReport
inputReport) at
System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr
hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions,
Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32
virtualKey) at
System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG&
msg, Boolean& handled) at
System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG&
msg, ModifierKeys modifiers) at
System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate
callback, Object args, Int32 numArgs) at
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source,
Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at
System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority
priority, TimeSpan timeout, Delegate method, Object args, Int32
numArgs) at
System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority
priority, Delegate method, Object arg) at
System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg,
Boolean& handled) at
System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG&
msg, Boolean& handled) at
System.Windows.Interop.ThreadMessageEventHandler.Invoke(MSG& msg,
Boolean& handled) at
System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG&
msg) at
System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame
frame) at
System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore) at
System.Windows.Application.RunInternal(Window window) at
System.Windows.Application.Run(Window window) at
System.Windows.Application.Run() at DCMatrix.App.Main()"
I have a xamarin forms switch , when it is toggled getting the following exception on ios version only:
{System.NullReferenceException: Object reference not set to an instance of an object
at Xamarin.Forms.Platform.iOS.SwitchRenderer.OnElementToggled (System.Object sender, System.EventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\SwitchRenderer.cs:78
at (wrapper delegate-invoke) System.EventHandler`1[Xamarin.Forms.ToggledEventArgs].invoke_void_object_TEventArgs(object,Xamarin.Forms.ToggledEventArgs)
at Xamarin.Forms.Switch+<>c.<.cctor>b__21_0 (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Switch.cs:14
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:343
at Xamarin.Forms.Element.SetValueFromRenderer (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:250
at Xamarin.Forms.Element.Xamarin.Forms.IElementController.SetValueFromRenderer (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:246
at Xamarin.Forms.Platform.iOS.SwitchRenderer.OnControlValueChanged (System.Object sender, System.EventArgs e) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\SwitchRenderer.cs:73
at UIKit.UIControlEventProxy.Activated () [0x00004] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIControl.cs:38
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/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at WeCareMobility.iOS.Application.Main (System.String[] args) [0x00002] in /Users/user/Desktop/Vipin/Copiloto/Mobile/WeCareMobility/WeCareMobility.iOS/Main.cs:20 }
Xaml:
<Switch Grid.Row="0" Grid.Column="1" Margin="{OnPlatform Android='0,0,25,0',iOS='0,0,0,8'}" Scale="{OnPlatform iOS= '0.7'}" VerticalOptions="Start" HorizontalOptions="FillAndExpand" IsToggled="False" Toggled="Switch_Toggled" />
CS:
private void Switch_Toggled(object sender, ToggledEventArgs e)
{
// Perform an action after examining e.Value
if (e.Value)
{
App.Current.MainPage = new NavigationPage(new FlyoutPage());
_weCareStorageService.SetToggleValue(true);
}
}
I do not have any renderer for switch. It is working fine for android.
Upgraded to latest xamarin forms stable version 4.7.0.1080.
Using VS2019 mac. iOS sdk version:13.18.2.1 .
Cleaned,rebuilt. Still crash occurs in ios. Need some help...
Navigation was the issue.Changed navigation like this:
Device.BeginInvokeOnMainThread(() => { App.Current.MainPage = new NavigationPage(new FlyoutPage()); });
Solved issue.
Getting an exception when selecting a Release Template and choosing "New Release" on "Configure Apps" tab of RM for Visual Studio 2013 Client.
After clicking "New Release" a pop-up appears in the lower right corner of the screen with "Unhandled Exception" and red stop sign. Looking through Event Viewer, below is the stack trace.
Anyone else encountering the same error?
The only step in the Release Template is to copy files to a DEV server on the same subnet.
Message: The remote server returned an error: (500) Internal Server Error.: \r\n\r\n at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.WebRequest.PlatformHttpClient.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndGetAsyncMemoryStreamFromResponse(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndDownloadString(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)
at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClient.EndPost(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.HttpRequestor.<>c__DisplayClass1.<GetPostCaller>b__0(String url, String body)
at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.BaseDeploymentControllerServiceProxy.PopulateTaggedActivities(String workflowXml, Int32 environmentId)
at Microsoft.TeamFoundation.Release.Data.Model.Release.BuildReleaseStages(ReleasePath selectedReleasePath, XElement applicationVersion)
at Microsoft.TeamFoundation.Release.Data.Model.Release.BringDataFromApplicationVersion()
at Microsoft.TeamFoundation.Release.Data.Model.Release.OnPropertyChanged(String propertyName, Boolean setDirty)
at Microsoft.TeamFoundation.Release.Data.Model.PropertyChangedBase.OnPropertyChanged(String propertyName)
at Microsoft.TeamFoundation.Release.Data.Model.Release.set_ApplicationVersionId(Int32 value)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ReleaseViewModel.Initialize(Int32 modelId)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ReleaseViewModel..ctor(String viewMode, Dictionary`2 popupParameters)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ApplicationVersionsViewModel.CreateNewRelease(Int32 releaseTemplateId)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ApplicationVersionsViewModel.CreateRelease(XElement selectedItem)
at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ApplicationVersionsViewModel.CreateNewRelease(Object selectedItems)
at Microsoft.VisualStudio.Release.ViewModel.Helpers.RelayCommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Category: General
Priority: -1
EventId: 0
Severity: Error
Issue was permissions related. Fixed by adding AD computer name in Release Management server users.
I thought apt-get install mono-dbg would solve it but i was wrong. How do i get debug information with mono? i am using debian squeeze but couldnt figure it out on debian lenny or etch.
I wrote a dummy program below and i was hoping for a line number but i got this instead. This is a copy/paste from the console/terminal.
Unhandled Exception: System.Exception: nooo blah
at ExceptionTest.Program.func (Int32 a) [0x00000] in <filename unknown>:0
at ExceptionTest.Program.func (Int32 a) [0x00000] in <filename unknown>:0
at ExceptionTest.Program.func (Int32 a) [0x00000] in <filename unknown>:0
at ExceptionTest.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ExceptionTest
{
class Program
{
static void Main(string[] args)
{
func(3);
}
static void func(int a)
{
if (a == 18)
throw new Exception("nooo blah");
func(a + a + 2);
}
}
}
To get file names and line numbers, compile your application with -debug (like gmcs -debug prog.cs) and then run mono --debug prog.exe.
The mono-dbg package gives you debugging symbols for /usr/bin/mono (and libmono).
$ gmcs -debug prog.cs
$ mono --debug prog.exe
Unhandled Exception: System.Exception: nooo blah
at ExceptionTest.Program.func (Int32 a) [0x0001d] in /tmp/prog.cs:19
at ExceptionTest.Program.func (Int32 a) [0x00013] in /tmp/prog.cs:18
at ExceptionTest.Program.func (Int32 a) [0x00013] in /tmp/prog.cs:18
at ExceptionTest.Program.Main (System.String[] args) [0x00000] in /tmp/prog.cs:12