Giter VIP home page Giter VIP logo

Comments (4)

tipa avatar tipa commented on June 14, 2024 1

Can confirm it now works again (with alpha27). Thanks for the quick help!

from binance.

sonvister avatar sonvister commented on June 14, 2024

@tipa, I added exception handling to the BinanceHttpClient constructor to help troubleshoot this issue. Also, I made the constructor public (no longer enforcing recommended singleton use) so you can instantiate with logger without using dependency injection (dependency injection is recommended).

If your issue happens to be with the recent workaround setting of ConnectionLeaseTimeout, this can be disabled by setting the corresponding BinanceApiOptions value to 0.

These changes are in 0.2.0-alpha26.

from binance.

tipa avatar tipa commented on June 14, 2024

Thanks for the prompt response! Does the crash log (alpha26) below help? It looks like it is related to the BinanceApiOptions. When calling new BinanceApi(new BinanceHttpClient(null, null, this, null)) (where this is implementing IOptions<BinanceApiOptions> returning new BinanceApiOptions() { ServicePointManagerConnectionLeaseTimeout = 0 }), the crash is not happening any more. When simply calling new BinanceApi(), the app crashes (see log below).
The problem does not seem to appear with 0.2.0-alpha24 at all.

Exception:

System.NotImplementedException: The method or operation is not implemented.

Exception:

System.ArgumentNullException: Value cannot be null.
Parameter name: logger

Unhandled Exception:

System.ArgumentNullException: Value cannot be null.
Parameter name: logger

Exception:

System.ArgumentNullException: Value cannot be null.
Parameter name: logger

02-04 17:44:48.601 D/Mono ( 9542): DllImport attempting to load: '/system/lib/liblog.so'.
02-04 17:44:48.601 D/Mono ( 9542): DllImport loaded library '/system/lib/liblog.so'.
02-04 17:44:48.601 D/Mono ( 9542): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
02-04 17:44:48.601 D/Mono ( 9542): Searching for '__android_log_print'.
02-04 17:44:48.601 D/Mono ( 9542): Probing '__android_log_print'.
02-04 17:44:48.601 D/Mono ( 9542): Found as '_android_log_print'.
02-04 17:44:48.605 I/MonoDroid( 9542): UNHANDLED EXCEPTION:
02-04 17:44:48.610 I/MonoDroid( 9542): System.ArgumentNullException: Value cannot be null.
02-04 17:44:48.610 I/MonoDroid( 9542): Parameter name: logger
02-04 17:44:48.610 I/MonoDroid( 9542): at Microsoft.Extensions.Logging.LoggerExtensions.LogError (Microsoft.Extensions.Logging.ILogger logger, System.Exception exception, System.String message, System.Object[] args) [0x00003] in :0
02-04 17:44:48.610 I/MonoDroid( 9542): at Binance.Api.BinanceHttpClient..ctor (Binance.Api.ITimestampProvider timestampProvider, Binance.Api.IApiRateLimiter rateLimiter, Microsoft.Extensions.Options.IOptions1[TOptions] options, Microsoft.Extensions.Logging.ILogger1[TCategoryName] logger) [0x0014e] in <406c94274e0a46b18f5c172d540c8725>:0
02-04 17:44:48.610 I/MonoDroid( 9542): at Binance.Api.BinanceHttpClient+<>c.<.cctor>b__29_0 () [0x00000] in <406c94274e0a46b18f5c172d540c8725>:0
02-04 17:44:48.610 I/MonoDroid( 9542): at System.Lazy1[T].CreateValue () [0x00081] in <657aa8fea4454dc898a9e5f379c58734>:0 02-04 17:44:48.610 I/MonoDroid( 9542): at System.Lazy1[T].LazyInitValue () [0x00080] in <657aa8fea4454dc898a9e5f379c58734>:0
02-04 17:44:48.610 I/MonoDroid( 9542): at System.Lazy1[T].get_Value () [0x0003a] in <657aa8fea4454dc898a9e5f379c58734>:0 02-04 17:44:48.610 I/MonoDroid( 9542): at Binance.Api.BinanceHttpClient.get_Instance () [0x00000] in <406c94274e0a46b18f5c172d540c8725>:0 02-04 17:44:48.610 I/MonoDroid( 9542): at Binance.Api.BinanceApi..ctor () [0x00000] in <406c94274e0a46b18f5c172d540c8725>:0 02-04 17:44:48.610 I/MonoDroid( 9542): at Coini.BinanceWallet..ctor (System.String credentials, System.String id) [0x00045] in C:\Users\timop\Desktop\APPS\Coini\Coini\Wallets\BinanceWallet.cs:33 02-04 17:44:48.610 I/MonoDroid( 9542): at Coini.Helper.GetWalletInstanceByName (System.String name, System.String credentials, System.String id) [0x0001b] in C:\Users\timop\Desktop\APPS\Coini\Coini\Helper\Helper.cs:266 02-04 17:44:48.610 I/MonoDroid( 9542): at Coini.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x000d8] in C:\Users\timop\Desktop\APPS\Coini\Coini.Android\Activities\MainActivity.cs:63 02-04 17:44:48.610 I/MonoDroid( 9542): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x0000f] in <848bbd7c681a4975918c72f17d2f5144>:0 02-04 17:44:48.610 I/MonoDroid( 9542): at (wrapper dynamic-method) System.Object:cb95a0e2-3d29-403a-8e82-0c1ff2434e21 (intptr,intptr,intptr) 02-04 17:44:48.627 E/AppCenterCrashes( 9542): Unhandled Exception: 02-04 17:44:48.627 E/AppCenterCrashes( 9542): System.ArgumentNullException: Value cannot be null. 02-04 17:44:48.627 E/AppCenterCrashes( 9542): Parameter name: logger 02-04 17:44:48.627 E/AppCenterCrashes( 9542): at Microsoft.Extensions.Logging.LoggerExtensions.LogError (Microsoft.Extensions.Logging.ILogger logger, System.Exception exception, System.String message, System.Object[] args) [0x00003] in <a8f53157bc3f43a4b1754437a933078f>:0 02-04 17:44:48.627 E/AppCenterCrashes( 9542): at Binance.Api.BinanceHttpClient..ctor (Binance.Api.ITimestampProvider timestampProvider, Binance.Api.IApiRateLimiter rateLimiter, Microsoft.Extensions.Options.IOptions1[TOptions] options, Microsoft.Extensions.Logging.ILogger1[TCategoryName] logger) [0x0014e] in <406c94274e0a46b18f5c172d540c8725>:0 02-04 17:44:48.627 E/AppCenterCrashes( 9542): at Binance.Api.BinanceHttpClient+<>c.<.cctor>b__29_0 () [0x00000] in <406c94274e0a46b18f5c172d540c8725>:0 02-04 17:44:48.627 E/AppCenterCrashes( 9542): at System.Lazy1[T].CreateValue () [0x00081] in <657aa8fea4454dc898a9e5f379c58734>:0
02-04 17:44:48.627 E/AppCenterCrashes( 9542): at System.Lazy1[T].LazyInitValue () [0x00080] in <657aa8fea4454dc898a9e5f379c58734>:0 02-04 17:44:48.627 E/AppCenterCrashes( 9542): at System.Lazy1[T].get_Value () [0x0003a] in <657aa8fea4454dc898a9e5f379c58734>:0
02-04 17:44:48.627 E/AppCenterCrashes( 9542): at Binance.Api.BinanceHttpClient.get_Instance () [0x00000] in <406c94274e0a46b18f5c172d540c8725>:0
02-04 17:44:48.627 E/AppCenterCrashes( 9542): at Binance.Api.BinanceApi..ctor () [0x00000] in <406c94274e0a46b18f5c172d540c8725>:0
02-04 17:44:48.627 E/AppCenterCrashes( 9542): at Coini.BinanceWallet..ctor (System.String credentials, System.String id) [0x00045] in C:\Users\timop\Desktop\APPS\Coini\Coini\Wallets\BinanceWallet.cs:33
02-04 17:44:48.627 E/AppCenterCrashes( 9542): at Coini.Helper.GetWalletInstanceByName (System.String name, System.String credentials, System.String id) [0x0001b] in C:\Users\timop\Desktop\APPS\Coini\Coini\Helper\Helper.cs:266
02-04 17:44:48.627 E/AppCenterCrashes( 9542): at Coini.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x000d8] in C:\Users\timop\Desktop\APPS\Coini\Coini.Android\Activities\MainActivity.cs:63
02-04 17:44:48.627 E/AppCenterCrashes( 9542): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle
(System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x0000f] in <848bbd7c681a4975918c72f17d2f5144>:0
02-04 17:44:48.627 E/AppCenterCrashes( 9542): at (wrapper dynamic-method) System.Object:cb95a0e2-3d29-403a-8e82-0c1ff2434e21 (intptr,intptr,intptr)
02-04 17:44:48.635 D/Mono ( 9542): Assembly Ref addref Microsoft.AppCenter.Crashes[0xa843bb00] -> System.Core[0x9442fd20]: 6
02-04 17:44:48.848 D/Mono ( 9542): DllImport searching in: '__Internal' ('(null)').
02-04 17:44:48.848 D/Mono ( 9542): Searching for 'java_interop_jnienv_new_byte_array'.
02-04 17:44:48.848 D/Mono ( 9542): Probing 'java_interop_jnienv_new_byte_array'.
02-04 17:44:48.848 D/Mono ( 9542): Found as 'java_interop_jnienv_new_byte_array'.
02-04 17:44:48.850 D/Mono ( 9542): DllImport searching in: '__Internal' ('(null)').
02-04 17:44:48.850 D/Mono ( 9542): Searching for 'java_interop_jnienv_set_byte_array_region'.
02-04 17:44:48.850 D/Mono ( 9542): Probing 'java_interop_jnienv_set_byte_array_region'.
02-04 17:44:48.850 D/Mono ( 9542): Found as 'java_interop_jnienv_set_byte_array_region'.
02-04 17:44:48.879 W/art ( 9542): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
02-04 17:44:48.885 D/Mono ( 9542): DllImport searching in: '__Internal' ('(null)').
02-04 17:44:48.885 D/Mono ( 9542): Searching for 'java_interop_jnienv_throw'.
02-04 17:44:48.885 D/Mono ( 9542): Probing 'java_interop_jnienv_throw'.
02-04 17:44:48.885 D/Mono ( 9542): Found as 'java_interop_jnienv_throw'.
An unhandled exception occured.

02-04 17:44:50.411 E/mono ( 9542):
02-04 17:44:50.411 E/mono ( 9542): Unhandled Exception:
02-04 17:44:50.411 E/mono ( 9542): System.ArgumentNullException: Value cannot be null.
02-04 17:44:50.411 E/mono ( 9542): Parameter name: logger
02-04 17:44:50.411 E/mono ( 9542): at (wrapper dynamic-method) System.Object:cb95a0e2-3d29-403a-8e82-0c1ff2434e21 (intptr,intptr,intptr)
02-04 17:44:50.411 E/mono-rt ( 9542): [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Value cannot be null.
02-04 17:44:50.411 E/mono-rt ( 9542): Parameter name: logger
02-04 17:44:50.411 E/mono-rt ( 9542): at (wrapper dynamic-method) System.Object:cb95a0e2-3d29-403a-8e82-0c1ff2434e21 (intptr,intptr,intptr)

from binance.

sonvister avatar sonvister commented on June 14, 2024

@tipa, yes. That all helps, thanks.

The problem is with the recently added workaround I added (proactively to help, but worse so far). The new exception is the result of my 'promptness' and forgetting to use _logger?. I will change the default behavior to not apply the workaround (equivalent to setting the option to 0) and fix the logger issue. You should then be able to call the default constructor without crashing in the next release. Also, I have unlisted 0.2.0-alpha26 from NuGet.

from binance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.