1

In xamarin, I call the api using the refit library. I have followed the instructions, but when calling the exception api was returned. I don't know if my combination of prism will affect? I have called a manual api but it also doesn't work I also consulted on the internet but it seems everything still doesn't work. In the Advanced Android Option I am setting the HttpClient implementation to Android, the SSL / TSL implementation is Default (Native TLS 1.2+) . Can I help me?

public interface IMakeUpApi
{
    [Get("/api/v2/items")]
    Task<string> GetMakeups();
}

In MainPageViewModel

var apiResponse = RestService.For<IMakeUpApi>("https://qiita.com");
var makeups = await apiResponse.GetMakeups();

Error

System.Net.Http.HttpRequestException Message=mono-io-layer-error (-1) Source=mscorlib StackTrace: at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threading.CancellationToken cancellationToken) [0x00180] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:84 at System.Threading.Tasks.ValueTask1[TResult].get_Result () [0x0001b] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Threading/Tasks/ValueTask.cs:813 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x000ea] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:371 at System.Threading.Tasks.ValueTask1[TResult].get_Result () [0x0001b] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Threading/Tasks/ValueTask.cs:813 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync (System.Threading.Tasks.ValueTask1[TResult] creationTask) [0x000a2] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:529 at System.Threading.Tasks.ValueTask1[TResult].get_Result () [0x0001b] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Threading/Tasks/ValueTask.cs:813 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync (System.Net.Http.HttpRequestMessage request, System.Boolean doRequestAuth, System.Threading.CancellationToken cancellationToken) [0x0003f] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:284 at System.Net.Http.RedirectHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00070] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs:32 at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered (System.Threading.Tasks.Task1[TResult] sendTask, System.Net.Http.HttpRequestMessage request, System.Threading.CancellationTokenSource cts, System.Boolean disposeCts) [0x000b3] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:531 at Refit.RequestBuilderImplementation+<>c__DisplayClass14_02[T,TBody].b__0 (System.Net.Http.HttpClient client, System.Threading.CancellationToken ct, System.Object[] paramList) [0x00188] in :0 at TestApp.ViewModels.MainPageViewModel.Navigate () [0x0003b] in E:\H\Xamarin\TestApp\TestApp\TestApp\ViewModels\MainPageViewModel.cs:58 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021 at Android.App.SyncContext+<>c__DisplayClass2_0.b__0 () [0x00000] in :0 at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in :0 at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in :0 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.39(intptr,intptr)

Detail Exception

  • ex {System.Net.Http.HttpRequestException: mono-io-layer-error (-1) ---> System.Net.Sockets.SocketException: mono-io-layer-error (-1) at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threading.CancellationToken cancellationToken) [0x000c8] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:65 --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threading.CancellationToken cancellationToken) [0x00180] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:84 at System.Threading.Tasks.ValueTask1[TResult].get_Result () [0x0001b] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Threading/Tasks/ValueTask.cs:813 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x000ea] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:371 at System.Threading.Tasks.ValueTask1[TResult].get_Result () [0x0001b] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Threading/Tasks/ValueTask.cs:813 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync (System.Threading.Tasks.ValueTask1[TResult] creationTask) [0x000a2] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:529 at System.Threading.Tasks.ValueTask1[TResult].get_Result () [0x0001b] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/Common/src/CoreLib/System/Threading/Tasks/ValueTask.cs:813 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync (System.Net.Http.HttpRequestMessage request, System.Boolean doRequestAuth, System.Threading.CancellationToken cancellationToken) [0x0003f] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:284 at System.Net.Http.RedirectHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00070] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs:32 at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered (System.Threading.Tasks.Task1[TResult] sendTask, System.Net.Http.HttpRequestMessage request, System.Threading.CancellationTokenSource cts, System.Boolean disposeCts) [0x000b3] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:531 at Refit.RequestBuilderImplementation+<>c__DisplayClass14_02[T,TBody].b__0 (System.Net.Http.HttpClient client, System.Threading.CancellationToken ct, System.Object[] paramList) [0x00188] in :0 at TestApp.ViewModels.MainPageViewModel.Navigate () [0x00044] in E:\H\Xamarin\TestApp\TestApp\TestApp\ViewModels\MainPageViewModel.cs:60 } System.Net.Http.HttpRequestException
  • base {System.Exception} System.Exception
  • Data {System.Collections.ListDictionaryInternal} System.Collections.ListDictionaryInternal HResult -2147467259 int HelpLink (null) string
  • InnerException {System.Net.Sockets.SocketException} System.Net.Sockets.SocketException
  • base {System.ComponentModel.Win32Exception} System.ComponentModel.Win32Exception
  • base {System.Runtime.InteropServices.ExternalException} System.Runtime.InteropServices.ExternalException
  • base {System.SystemException} System.SystemException
  • base {System.Exception} System.Exception
  • Data {System.Collections.ListDictionaryInternal} System.Collections.ListDictionaryInternal HResult -2147467259 int HelpLink (null) string InnerException (null) System.Exception Message "mono-io-layer-error (-1)" string Source "mscorlib" string StackTrace " at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threa…" string
  • TargetSite {System.Reflection.RuntimeMethodInfo} System.Reflection.RuntimeMethodInfo
  • base {System.Reflection.MethodInfo} System.Reflection.MethodInfo Attributes System.Reflection.MethodAttributes.FamANDAssem | System.Reflection.MethodAttributes.Family | System.Reflection.MethodAttributes.HideBySig System.Reflection.MethodAttributes CallingConvention System.Reflection.CallingConventions.HasThis | System.Reflection.CallingConventions.Standard System.Reflection.CallingConventions ContainsGenericParameters false bool
  • DeclaringType {System.RuntimeType} System.RuntimeType IsGenericMethod false bool IsGenericMethodDefinition false bool IsSecurityCritical true bool IsSecuritySafeCritical true bool IsSecurityTransparent false bool MetadataToken 100680451 int
  • MethodHandle {System.RuntimeMethodHandle} System.RuntimeMethodHandle
  • Module {System.Reflection.RuntimeModule} System.Reflection.RuntimeModule Name "Throw" string
  • ReflectedType {System.RuntimeType} System.RuntimeType
  • ReturnParameter {System.Reflection.RuntimeParameterInfo} System.Reflection.RuntimeParameterInfo
  • ReturnType {System.RuntimeType} System.RuntimeType
  • ReturnTypeCustomAttributes {System.Reflection.RuntimeParameterInfo} System.Reflection.RuntimeParameterInfo
  • Non-public members
    BindingFlags System.Reflection.BindingFlags.Default System.Reflection.BindingFlags
  • ReflectedTypeInternal {System.RuntimeType} System.RuntimeType mhandle 0xffffffff91fc61a8 System.IntPtr name "Throw" string
  • reftype {System.RuntimeType} System.RuntimeType
  • Static members
  • Non-public members
    ErrorCode -1 int NativeErrorCode -1 int
  • Non-public members
    ErrorCode -1 int Message "mono-io-layer-error (-1)" string SocketErrorCode System.Net.Sockets.SocketError.SocketError System.Net.Sockets.SocketError
  • Non-public members
    Message "mono-io-layer-error (-1)" string Source "mscorlib" string StackTrace " at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threa…" string
  • TargetSite {System.Reflection.RuntimeMethodInfo} System.Reflection.RuntimeMethodInfo
  • Static members
  • Non-public members
    _COMPlusExceptionCode -532462766 int
  • s_EDILock {object} object
  • Non-public members
    IsTransient System.NotImplementedException: The method or operation is not implemented. bool RemoteStackTrace (null) string _HResult -2147467259 int _className "System.Net.Http.HttpRequestException" string
  • _data {System.Collections.ListDictionaryInternal} System.Collections.ListDictionaryInternal _dynamicMethods (null) object _helpURL (null) string
  • _innerException {System.Net.Sockets.SocketException} System.Net.Sockets.SocketException _message "mono-io-layer-error (-1)" string _remoteStackIndex 0 int _remoteStackTraceString (null) string
  • _safeSerializationManager {System.Runtime.Serialization.SafeSerializationManager} System.Runtime.Serialization.SafeSerializationManager _source "mscorlib" string
  • _stackTrace {System.IntPtr[18]} System.IntPtr[] _stackTraceString (null) string
  • captured_traces {System.Diagnostics.StackTrace[7]} System.Diagnostics.StackTrace[] caught_in_unmanaged 0 int native_trace_ips (null) System.IntPtr[]
hungnt03
  • 61
  • 5

0 Answers0