trying to troubleshoot my wcf connection when it is throwing this error,
im not really sure what it is telling me as i have never worked with this kind of stuff before
ERROR System error.
at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_delegate_end_invoke (object,intptr)
ERROR System error.
at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_delegate_end_invoke (object,intptr)
05-31 13:16:42.025 I/mono-stdout( 5037): at (wrapper delegate-end-invoke) <Module>:end_invoke_object__this___object[]&_IAsyncResult (object[]&,System.IAsyncResult)
at (wrapper delegate-end-invoke) <Module>:end_invoke_object__this___object[]&_IAsyncResult (object[]&,System.IAsyncResult)
05-31 13:16:42.025 I/mono-stdout( 5037): at System.ServiceModel.MonoInternal.ClientRuntimeChannel.EndProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters, IAsyncResult result) [0x00025] in /Users/builder/data/lanes/2512/d3008455/source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:460
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.EndProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters, IAsyncResult result) [0x00025] in /Users/builder/data/lanes/2512/d3008455/source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:460
05-31 13:16:42.025 I/mono-stdout( 5037): at System.ServiceModel.ClientBase`1+ChannelBase`1[TChannel,T].EndInvoke (System.String methodName, System.Object[] args, IAsyncResult result) [0x0003c] in /Users/builder/data/lanes/2512/d3008455/source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientBase.cs:404
at System.ServiceModel.ClientBase`1+ChannelBase`1[TChannel,T].EndInvoke (System.String methodName, System.Object[] args, IAsyncResult result) [0x0003c] in /Users/builder/data/lanes/2512/d3008455/source/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientBase.cs:404
05-31 13:16:42.025 I/mono-stdout( 5037): at CommunityGenerousity.CommunityGenerosiryServiceReference.CommunityGenerosityClient+CommunityGenerosityClientChannel.EndGetActivitys (IAsyncResult result) [0x00008] in \CommunityGenerousity\CommunityGenerousity\CommunityGenerousity\Service References\CommunityGenerosiryServiceReference\Reference.cs:914
at CommunityGenerousity.CommunityGenerosiryServiceReference.CommunityGenerosityClient+CommunityGenerosityClientChannel.EndGetActivitys (IAsyncResult result) [0x00008] in \CommunityGenerousity\CommunityGenerousity\CommunityGenerousity\Service References\CommunityGenerosiryServiceReference\Reference.cs:914
05-31 13:16:42.025 I/mono-stdout( 5037): at CommunityGenerousity.CommunityGenerosiryServiceReference.CommunityGenerosityClient.CommunityGenerousity.CommunityGenerosiryServiceReference.CommunityGenerosity.EndGetActivitys (IAsyncResult result) [0x00001] in \CommunityGenerousity\CommunityGenerousity\CommunityGenerousity\Service References\CommunityGenerosiryServiceReference\Reference.cs:571
at CommunityGenerousity.CommunityGenerosiryServiceReference.CommunityGenerosityClient.CommunityGenerousity.CommunityGenerosiryServiceReference.CommunityGenerosity.EndGetActivitys (IAsyncResult result) [0x00001] in \CommunityGenerousity\CommunityGenerousity\CommunityGenerousity\Service References\CommunityGenerosiryServiceReference\Reference.cs:571
05-31 13:16:42.025 I/mono-stdout( 5037): at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (IAsyncResult iar, System.Func`2 endFunction, System.Action`1 endAction, System.Threading.Tasks.Task`1 promise, Boolean requiresSynchronization) [0x00014] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs:552
at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (IAsyncResult iar, System.Func`2 endFunction, System.Action`1 endAction, System.Threading.Tasks.Task`1 promise, Boolean requiresSynchronization) [0x00014] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs:552
05-31 13:16:42.025 I/mono-stdout( 5037): --- End of stack trace from previous location where exception was thrown ---
--- End of stack trace from previous location where exception was thrown ---
05-31 13:16:42.025 I/mono-stdout( 5037): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
05-31 13:16:42.025 I/mono-stdout( 5037): at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:201
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00047] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:201
05-31 13:16:42.025 I/mono-stdout( 5037): at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:170
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:170
05-31 13:16:42.025 I/mono-stdout( 5037): at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:142
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:142
05-31 13:16:42.025 I/mono-stdout( 5037): at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:372
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Users/builder/data/lanes/2512/d3008455/source/mono/external/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:372
05-31 13:16:42.025 I/mono-stdout( 5037): at CommunityGenerousity.CommunityGenerosiryService+<GetActivitiesAsync>d__10.MoveNext () [0x00079] in CommunityGenerousity\CommunityGenerousity\CommunityGenerousity\CommunityGenerosiryService.cs:138
at CommunityGenerousity.CommunityGenerosiryService+<GetActivitiesAsync>d__10.MoveNext () [0x00079]
this is the code that is throwing the error:
var items= await Task.Factory.FromAsync<ObservableCollection<activityWCF>>(service.BeginGetActivitys, service.EndGetActivitys, null, TaskCreationOptions.None);
Related
I have a physical device connected. When the phone is locked and I deploy the application after unlocking, the application works and everything is fine. But if the screen is unlocked and I deploy I get the following error. In this case, everything is ok on the emulator. Help me understand this nonsense.
**System.NullReferenceException:** 'Object reference not set to an instance of an object.'
[HotReload] (2021-03-17 23:08:35.2): INFO: Инициализация горячей перезагрузки XAML…
[HotReload] (2021-03-17 23:08:35.2): WARN: (DriverHelper v 2.0.Android) Unknown Breakpoint Hit: Android.Runtime.JNIEnv.RegisterJniNatives( typeName_ptr, int typeName_len, jniClass, methods_ptr, int methods_len)
"<unnamed thread>" at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Diagnostics.Debugger.Mono_UnhandledException_internal (System.Exception) <0x00007>
at System.Diagnostics.Debugger.Mono_UnhandledException (System.Exception) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Diagnostics/Debugger.cs:125
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.46 (intptr,intptr) [0x00020] in <44e54a86dea24313a2bdb807df77c27a>:0
at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.46 (intptr,intptr) [0x00033] in <44e54a86dea24313a2bdb807df77c27a>:0
"ProtocolHandler.SendThread" at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait (object,int) <0x00007>
at System.Threading.Monitor.ObjWait (bool,int,object) [0x0002f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Threading/Monitor.cs:85
at System.Threading.Monitor.Wait (object,int,bool) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:218
at System.Threading.Monitor.Wait (object) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:238
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler/WaitableActionsList.WaitForData () [0x00019] in <c37c1589af144356b99fb170c5e22242>:0
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler.ActionThread (object) [0x00045] in <c37c1589af
144356b99fb170c5e22242>:0
at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00025] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:78
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:968
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/
03-17 23:08:49.317 E/mono (27416): Full thread dump:referencesource/mscorlib/system/threading/executioncontext.cs:899
at System.Threading.ThreadHelper.ThreadStart (object) [0x0000f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:93
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) [0x0006b] in <c72658f647bc485bbfb8c9fcaa790862>:0
"<threadpool thread>"
"Debugger agent"
"Thread Pool Worker"
"Thread Pool Worker"
"Thread Pool Worker"
"Timer-Scheduler"
"Finalizer"
"ProtocolHandler.ProcessThread" at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait (object,int) <0x00007>
at System.Threading.Monitor.ObjWait (bool,int,object) [0x0002f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Threading/Monitor.cs:85
at System.Threading.Monitor.Wait (object,int,bool) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android
/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:218
at System.Threading.Monitor.Wait (object) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:238
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler/WaitableActionsList.WaitForData () [0x00019] in <c37c1589af144356b99fb170c5e22242>:0
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler.ActionThread (object) [0x00045] in <c37c1589af144356b99fb170c5e22242>:0
at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00025] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:78
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/re
ferencesource/mscorlib/system/threading/executioncontext.cs:968
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:899
at System.Threading.ThreadHelper.ThreadStart (object) [0x0000f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:93
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) [0x0006b] in <c72658f647bc485bbfb8c9fcaa790862>:0
"ProtocolHandler.ReadThread" at <unknow
n> <0xffffffff>
at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait (object,int) <0x00007>
at System.Threading.Monitor.ObjWait (bool,int,object) [0x0002f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Threading/Monitor.cs:85
at System.Threading.Monitor.Wait (object,int,bool) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:218
at System.Threading.Monitor.Wait (object) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:238
at Xamarin.HotReload.HotReloadAgent.Microsoft.VisualStudio.DesignTools.TapContract.Networking.IDataBridge.ReadMessage () [0x0002f] in D:\a\1\s\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:341
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler.ReadThread () [0x00038] in <c37c1589af144356b99fb170c
5e22242>:0
at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00014] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:74
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:968
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource
/mscorlib/system/threading/executioncontext.cs:899
at System.Threading.ThreadHelper.ThreadStart () [0x00008] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:111
at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x00067] in <c72658f647bc485bbfb8c9fcaa790862>:0
I am sending a large video file (average file size of 50mb) to my server using HttpClient and PostAsync. I am getting an exception (see below for full exception details). I found a article that the maximimum file size that can be handled is 1mb or less is this true? If so, how can I increase the maximum file size?
{System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.IO.IOException: Error writing request ---> System.Net.Sockets.SocketException: The socket has been shut down
at System.Net.WebConnection.EndWrite (System.Net.HttpWebRequest request, System.Boolean throwOnError, System.IAsyncResult result) [0x000cc] in <2016f34fb49d404d9e9f5c5e62749987>:0
at System.Net.WebConnectionStream.WriteAsyncCB (System.IAsyncResult r) [0x00013] in <2016f34fb49d404d9e9f5c5e62749987>:0
--- End of inner exception stack trace ---
at System.Net.WebConnectionStream.EndWrite (System.IAsyncResult r) [0x000b8] in <2016f34fb49d404d9e9f5c5e62749987>:0
at System.IO.Stream+<>c.b__53_1 (System.IO.Stream stream, System.IAsyncResult asyncResult) [0x00000] in :0
at (wrapper delegate-invoke) System.Func3[System.IO.Stream,System.IAsyncResult,System.Threading.Tasks.VoidTaskResult].invoke_TResult_T1_T2(System.IO.Stream,System.IAsyncResult)
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 :0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in :0
at System.Net.Http.HttpClientHandler+d__64.MoveNext () [0x0036e] in :0
--- End of inner exception stack trace ---
at System.Net.Http.HttpClientHandler+d__64.MoveNext () [0x00489] in :0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <df077aeeed724748974ac70c763795f3>:0
at System.Net.Http.HttpClient+<SendAsyncWorker>d__49.MoveNext () [0x000ca] in <e4f3fb4cf2054f718c1099b587ec6f1e>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <df077aeeed724748974ac70c763795f3>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <df077aeeed724748974ac70c763795f3>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <df077aeeed724748974ac70c763795f3>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <df077aeeed724748974ac70c763795f3>:0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in :0
at TBSMobile.View.MainMenu+d__22.MoveNext () [0x00b96] in C:\Users\lawre\source\repos\TBSMobile\TBSMobile\TBSMobile\View\MainMenu.xaml.cs:1088 }
byte[] crVideoData;
if (!string.IsNullOrEmpty(crvideo))
{
crVideoData = File.ReadAllBytes(crvideo);
}
else
{
crVideoData = null;
}
try
{
if (!string.IsNullOrEmpty(crvideo))
{
var vidlink = "http://" + ipaddress + Constants.requestUrl + "Host=" + host + "&Database=" + database + "&Contact=" + contact + "&Request=Lqr9fy";
string vidcontentType = "application/json";
JObject vidjson = new JObject
{
{ "CAFNo", crcafNo },
{ "CAFDate", crcafDate },
{ "Video", crVideoData }
};
HttpClient vidclient = new HttpClient();
var vidresponse = await vidclient.PostAsync(vidlink, new StringContent(vidjson.ToString(), Encoding.UTF8, vidcontentType));
if (vidresponse.IsSuccessStatusCode)
{
await conn.QueryAsync<CAFTable>("UPDATE tblCaf SET LastSync = ? WHERE CAFNo = ?", DateTime.Parse(current_datetime), crcafNo);
}
}
else
{
await conn.QueryAsync<CAFTable>("UPDATE tblCaf SET LastSync = ? WHERE CAFNo = ?", DateTime.Parse(current_datetime), crcafNo);
}
}
catch(Exception ex)
{
Crashes.TrackError(ex);
}
If your are saving the uploaded video in server using api, May be your max request length smaller than your uploded video size. If you want to upload high size video, Then increase the max request length in your webconfig file. Here is the sample code for increasing max request lenght in web api project.
<httpRuntime targetFramework="4.5.2" maxRequestLength="15200" />
I'm trying to follow the example for signing up a user in Cognito using C# from here. I had to add some stuff because AmazonCognitoIdentityProviderClient doesn't have an empty constructor. My app happens to be a Xamarin Forms app, but that shouldn't matter. I tried doing it in a .NETStandard project but kept getting an error saying that the method doesn't exist. So I switched to a PCL and now I'm getting System.IO.InvalidDataException: Cannot determine protocol. I get this error on both Android and iOS.
Here is my code:
public async Task SignupUser(string username, string password, string email)
{
const string UserPoolId = "us-east-1_XXXXXXXXX";
const string ClientId = "6xxxxxxxxxxxxxxxxxxxxxxxxx";
const string ClientSecret = "my-client-secret";
const string CognitoIdentityPoolId = "us-east-1:identity-pool-id-here";
try
{
AmazonCognitoIdentityProviderConfig providerConfig = new AmazonCognitoIdentityProviderConfig()
{
RegionEndpoint = RegionEndpoint.USEast1
};
CognitoAWSCredentials cogCreds = new CognitoAWSCredentials(CognitoIdentityPoolId, RegionEndpoint.USEast1);
IdentityProvider = new AmazonCognitoIdentityProviderClient(cogCreds, RegionEndpoint.USEast1);
SignUpRequest signUpRequest = new SignUpRequest()
{
ClientId = ClientId,
Password = password,
Username = username
};
AttributeType emailAttribute = new AttributeType()
{
Name = "email",
Value = email
};
signUpRequest.UserAttributes.Add(emailAttribute);
var signUpResult = await IdentityProvider.SignUpAsync(signUpRequest);
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
}
Here is the exception:
System.IO.InvalidDataException: Cannot determine protocol
at Amazon.Runtime.Internal.Signer.SignRequest (Amazon.Runtime.IRequestContext requestContext) [0x0007a] in <e08989525980425e9b2f389f7417830e>:0
at Amazon.Runtime.Internal.Signer.PreInvoke (Amazon.Runtime.IExecutionContext executionContext) [0x00013] in <e08989525980425e9b2f389f7417830e>:0
at Amazon.Runtime.Internal.Signer.InvokeAsync[T] (Amazon.Runtime.IExecutionContext executionContext) [0x00000] in <e08989525980425e9b2f389f7417830e>:0
at Amazon.Runtime.Internal.PipelineHandler.InvokeAsync[T] (Amazon.Runtime.IExecutionContext executionContext) [0x0000e] in <e08989525980425e9b2f389f7417830e>:0
at Amazon.Runtime.Internal.CredentialsRetriever.<>n__0[T] (Amazon.Runtime.IExecutionContext executionContext) [0x00000] in <e08989525980425e9b2f389f7417830e>:0
at Amazon.Runtime.Internal.CredentialsRetriever+<InvokeAsync>d__7`1[T].MoveNext () [0x00103] in <e08989525980425e9b2f389f7417830e>:0
--- 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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/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.6.1.4/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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at Amazon.Runtime.Internal.RetryHandler+<InvokeAsync>d__10`1[T].MoveNext () [0x000b0] in <e08989525980425e9b2f389f7417830e>:0
--- 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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at Amazon.Runtime.Internal.RetryHandler+<InvokeAsync>d__10`1[T].MoveNext () [0x001b0] in <e08989525980425e9b2f389f7417830e>:0
--- 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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/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.6.1.4/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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at Amazon.Runtime.Internal.CallbackHandler+<InvokeAsync>d__9`1[T].MoveNext () [0x00080] in <e08989525980425e9b2f389f7417830e>:0
--- 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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/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.6.1.4/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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at Amazon.Runtime.Internal.CallbackHandler+<InvokeAsync>d__9`1[T].MoveNext () [0x00080] in <e08989525980425e9b2f389f7417830e>:0
--- 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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/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.6.1.4/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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at Amazon.Runtime.Internal.ErrorCallbackHandler+<InvokeAsync>d__5`1[T].MoveNext () [0x00099] in <e08989525980425e9b2f389f7417830e>:0
--- 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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/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.6.1.4/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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535
at Amazon.Runtime.Internal.MetricsHandler+<InvokeAsync>d__1`1[T].MoveNext () [0x000ab] in <e08989525980425e9b2f389f7417830e>:0
--- 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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/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.6.1.4/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.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.6.1.4/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357
I solved the same issue sending "null" as credentials in AmazonCognitoIdentityProviderClient constructor:
IdentityProvider = new AmazonCognitoIdentityProviderClient(null, RegionEndpoint.USEast1);
I don't know why but it works perfectly after that, no documentation found.
var region = RegionEndpoint.GetBySystemName("us-west-2"); // use the region that you need
IdentityProvider = new AmazonCognitoIdentityProviderClient(null, region);
I have built a Xamarin forms app with PCL.
The application crashes sometimes on await Navigation.PopAsync();
I have found this https://forums.xamarin.com/discussion/62414/app-resuming-results-in-crash-with-formsappcompatactivity, but it's doesn't help
It appears only on android 5.0 and above. I'm using Xamarin.Forms 2.3.3
Here is crash log:
Xamarin caused by: android.runtime.JavaProxyThrowable: System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.AggregateException: One or more errors occurred. ---> Java.Lang.RuntimeException: Can not perform this action after onSaveInstanceState
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in <bd356ef77b9a4127a500b8385b303c4b>:0
at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x0000e] in <bc38a7e9ac144e5b8f3cbfa1d1cb295b>:0
at Android.Support.V4.App.FragmentTransactionInvoker.Commit () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.SwitchContentAsync (Xamarin.Forms.Page view, System.Boolean animated, System.Boolean removed, System.Boolean popToRoot) [0x0014b] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnPopViewAsync (Xamarin.Forms.Page page, System.Boolean animated) [0x00021] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.PopViewAsync (Xamarin.Forms.Page page, System.Boolean animated) [0x00000] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnPopped (System.Object sender, Xamarin.Forms.Internals.NavigationRequestedEventArgs e) [0x0000e] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.NavigationPage+<Xamarin-Forms-INavigationPageController-PopAsyncInner>d__63.MoveNext () [0x0006e] in <83d3340f3b274d389854ce45f51043f6>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at Xamarin.Forms.NavigationPage+<PopAsync>d__38.MoveNext () [0x001b9] in <83d3340f3b274d389854ce45f51043f6>:0
--- End of inner exception stack trace ---
at Xamarin.Forms.NavigationPage+<>c.<SafePop>b__93_0 (System.Threading.Tasks.Task`1[TResult] t) [0x0000e] in <83d3340f3b274d389854ce45f51043f6>:0
at System.Threading.Tasks.ContinuationTaskFromResultTask`1[TAntecedentResult].InnerInvoke () [0x00027] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Threading.Tasks.Task.Execute () [0x00016] in <7f637a73ebd0402caa24252e5f30bf7b>:0
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> Java.Lang.RuntimeException: Can not perform this action after onSaveInstanceState
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in <bd356ef77b9a4127a500b8385b303c4b>:0
at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x0000e] in <bc38a7e9ac144e5b8f3cbfa1d1cb295b>:0
at Android.Support.V4.App.FragmentTransactionInvoker.Commit () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.SwitchContentAsync (Xamarin.Forms.Page view, System.Boolean animated, System.Boolean removed, System.Boolean popToRoot) [0x0014b] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnPopViewAsync (Xamarin.Forms.Page page, System.Boolean animated) [0x00021] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.PopViewAsync (Xamarin.Forms.Page page, System.Boolean animated) [0x00000] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnPopped (System.Object sender, Xamarin.Forms.Internals.NavigationRequestedEventArgs e) [0x0000e] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.NavigationPage+<Xamarin-Forms-INavigationPageController-PopAsyncInner>d__63.MoveNext () [0x0006e] in <83d3340f3b274d389854ce45f51043f6>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at Xamarin.Forms.NavigationPage+<PopAsync>d__38.MoveNext () [0x001b9] in <83d3340f3b274d389854ce45f51043f6>:0
--- End of inner exception stack trace ---
at Xamarin.Forms.NavigationPage+<>c.<SafePop>b__93_0 (System.Threading.Tasks.Task`1[TResult] t) [0x0000e] in <83d3340f3b274d389854ce45f51043f6>:0
at System.Threading.Tasks.ContinuationTaskFromResultTask`1[TAntecedentResult].InnerInvoke () [0x00027] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Threading.Tasks.Task.Execute () [0x00016] in <7f637a73ebd0402caa24252e5f30bf7b>:0
---> (Inner Exception #0) Java.Lang.RuntimeException: Can not perform this action after onSaveInstanceState
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method) [0x00084] in <bd356ef77b9a4127a500b8385b303c4b>:0
at Android.Runtime.JNIEnv.CallIntMethod (System.IntPtr jobject, System.IntPtr jmethod) [0x0000e] in <bc38a7e9ac144e5b8f3cbfa1d1cb295b>:0
at Android.Support.V4.App.FragmentTransactionInvoker.Commit () [0x00033] in <27c17fe440cf491ba8255bcefade6e02>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.SwitchContentAsync (Xamarin.Forms.Page view, System.Boolean animated, System.Boolean removed, System.Boolean popToRoot) [0x0014b] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnPopViewAsync (Xamarin.Forms.Page page, System.Boolean animated) [0x00021] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.PopViewAsync (Xamarin.Forms.Page page, System.Boolean animated) [0x00000] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnPopped (System.Object sender, Xamarin.Forms.Internals.NavigationRequestedEventArgs e) [0x0000e] in <651b788f2205433c9db3a98957b5b8aa>:0
at Xamarin.Forms.NavigationPage+<Xamarin-Forms-INavigationPageController-PopAsyncInner>d__63.MoveNext () [0x0006e] in <83d3340f3b274d389854ce45f51043f6>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <7f637a73ebd0402caa24252e5f30bf7b>:0
at Xamarin.Forms.NavigationPage+<PopAsync>d__38.MoveNext () [0x001b9] in <83d3340f3b274d389854ce45f51043f6>:0
--- End of managed Java.Lang.RuntimeException stack trace ---
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1493)
at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1511)
at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:638)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:617)
at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onBackPressed(Native Method)
at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onBackPressed(FormsAppCompatActivity.java:40)
at android.app.Activity.onKeyUp(Activity.java:2713)
at android.view.KeyEvent.dispatch(KeyEvent.java:3280)
at android.app.Activity.dispatchKeyEvent(Activity.java:2983)
at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:524)
at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:241)
at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2689)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5233)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5186)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4686)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4652)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4794)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4660)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4851)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4686)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4652)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4660)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4633)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4686)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4652)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4827)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:5070)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2877)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2449)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2440)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2854)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:7230)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Because the FormsAppCompatActivity
didn't allow your code to manipulate the page diplaying...
That's all. I've searched a lot, and no choice for this moment. Maybe it's a bug, anyway we had right of Push, so would that. But it wouldn't.
Solution I choosed was:
find out the target page from the history
remove it from the NavigationStack, in order to push it back to the top of the NavigationStack
then I could cut off the wanted pages of the NavigationStack
The first row is saying your task crashed so your app crashed. Adding this class
public static class LogException
{
public static void LogExceptions(this Task task)
{
task.ContinueWith(t =>
{
var aggException = t.Exception.Flatten();
foreach (var exception in aggException.InnerExceptions)
{
System.Diagnostics.Debug.WriteLine("LOG EXCEPTION catch: " + exception);
}
},
TaskContinuationOptions.OnlyOnFaulted);
}
}
and using it like this:
Task.Factory.StartNew(() => PopYourPage()).LogExceptions();
would catch these exceptions not killing your app.
What are you popping, can you explain it better?
I'm newbie to learn xamarin. When i download sample and build but I got error
Severity Code Description Project File Line Suppression State
Error The "CollectBundleResources" task failed unexpectedly.
Xamarin.Messaging.Exceptions.MessagingRemoteException: An error occured on client Build403214 while executing a reply for topic xvs/Build/4.0.3.214/copy-item/SamplyGameiOS/25940bb/CoreData.pak ---> System.IO.DirectoryNotFoundException: Could not find a part of the path "/Users/niennguyen/Library/Caches/Xamarin/mtbs/builds/SamplyGameiOS/25940bb6fa00542affd423f61b9739d0/D:/SamplyGame/packages/UrhoSharp.1.0.410/build/Xamarin.iOS10/../../native"
at System.IO.Directory.CreateDirectoriesInternal (System.String path) <0x19fb700 + 0x00148> in <filename unknown>:0
at System.IO.Directory.CreateDirectory (System.String path) <0x19fb4f0 + 0x000c7> in <filename unknown>:0
at Xamarin.Messaging.Build.Handlers.CopyItemMessageHandler+<>c__DisplayClass1_0.<ExecuteAsync>b__0 () <0x33203b8 + 0x000b7> in <filename unknown>:0
at System.Threading.Tasks.Task.InnerInvoke () <0x1935f30 + 0x00051> in <filename unknown>:0
at System.Threading.Tasks.Task.Execute () <0x1935780 + 0x0004d> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x188f5d0 + 0x00035> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x188cf00 + 0x000b7> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x188ce60 + 0x00087> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x188ce10 + 0x0003f> in <filename unknown>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () <0x188d3c0 + 0x0001f> in <filename unknown>:0
at Xamarin.Messaging.Build.Handlers.CopyItemMessageHandler+<ExecuteAsync>d__1.MoveNext () <0x3320000 + 0x00253> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x188f5d0 + 0x00035> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x188cf00 + 0x000b7> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x188ce60 + 0x00087> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x188ce10 + 0x0003f> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () <0x188cde0 + 0x0001f> in <filename unknown>:0
at Xamarin.Messaging.Client.RequestHandler`1+<HandleAsync>d__5[TMessage].MoveNext () <0x331f780 + 0x0035b> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x188f5d0 + 0x00035> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x188cf00 + 0x000b7> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x188ce60 + 0x00087> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x188ce10 + 0x0003f> in <filename unknown>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () <0x188d3c0 + 0x0001f> in <filename unknown>:0
at Xamarin.Messaging.Client.MessageHandlerManager+<>c__DisplayClass17_1`1+<<RegisterHandlerAsync>b__3>d[TMessage].MoveNext () <0x331f110 + 0x00257> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x188f5d0 + 0x00035> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x188cf00 + 0x000b7> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x188ce60 + 0x00087> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x188ce10 + 0x0003f> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () <0x188cde0 + 0x0001f> in <filename unknown>:0
at Xamarin.Messaging.Client.MessagingClient+<>c__DisplayClass36_0`1+<<ReplyAsync>b__0>d[TRequest].MoveNext () <0x331eba0 + 0x0011b> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x188f5d0 + 0x00035> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x188cf00 + 0x000b7> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x188ce60 + 0x00087> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x188ce10 + 0x0003f> in <filename unknown>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () <0x188d600 + 0x00024> in <filename unknown>:0
at Xamarin.Messaging.Client.MessagingClient+<ReplyAsync>d__34`2[TRequest,TResponse].MoveNext () <0x31f70e0 + 0x00383> in <filename unknown>:0
--- End of inner exception stack trace ---
at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__23`2.MoveNext() in C:\Users\builder\data\lanes\3062\0dd817c0\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 188
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__22`2.MoveNext() in C:\Users\builder\data\lanes\3062\0dd817c0\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__26`2.MoveNext() in C:\Users\builder\data\lanes\3062\0dd817c0\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__32`1.MoveNext() in C:\Users\builder\data\lanes\3062\0dd817c0\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 306
--- End of stack trace from previous location where exception was thrown ---
at Xamarin.Messaging.Client.IMessagingClientExtensions.Execute(Action postAction) in C:\Users\builder\data\lanes\3062\0dd817c0\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\Extensions\IMessagingClientExtensions.cs:line 231
at Xamarin.Messaging.Client.IMessagingClientExtensions.Post[TRequest](IMessagingClient client, TRequest request, Boolean retain, Int32 timeoutSecs) in C:\Users\builder\data\lanes\3062\0dd817c0\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\Extensions\IMessagingClientExtensions.cs:line 195
at Xamarin.VisualStudio.Build.BuildClient.UploadItem(String path) in C:\Users\builder\data\lanes\3062\0dd817c0\source\XamarinVS\src\MSBuild\Xamarin.VisualStudio.Build\BuildClient.cs:line 99
at Xamarin.VisualStudio.Build.TaskRunner.CopyRequiredInputFiles(Task task) in C:\Users\builder\data\lanes\3062\0dd817c0\source\XamarinVS\src\MSBuild\Xamarin.VisualStudio.Build\TaskRunner.cs:line 219
at Xamarin.MacDev.Tasks.CollectBundleResources.Execute() in C:\Users\builder\data\lanes\3062\0dd817c0\source\XamarinVS\src\MSBuild\Xamarin.MacDev.Tasks\Tasks\CollectBundleResources.cs:line 14
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() SamplyGame.iOS