I am trying to use Commonutil to turn the LEDs on and off but when I try to use it I get these errors in the console when using CommonUtil
The ClassLoaderContext is a special shared library.
Error al inicializar CommonUtil: Wrong number of arguments; expected 0, got 1
This is the code I use:
try { commonUtil = CommonUtil(this) } catch (e: Exception) { Log.e("ScanTicketActivity", "Error al inicializar CommonUtil: ${e.message}") e.printStackTrace() // Mostrar un mensaje de error al usuario Toast.makeText(this, "Error al inicializar el SDK. Verifica las dependencias.", Toast.LENGTH_LONG).show() return // Salir si no se puede inicializar CommonUtil }
2025-01-15 11:49:06.563 6795-6795 com.telpo.cae com.telpo.cae I The ClassLoaderContext is a special shared library. 2025-01-15 11:49:06.697 6795-6795 ScanTicketActivity com.telpo.cae E Error al inicializar CommonUtil: Wrong number of arguments; expected 0, got 1 2025-01-15 11:49:06.697 6795-6795 System.err com.telpo.cae W java.lang.IllegalArgumentException: Wrong number of arguments; expected 0, got 1 2025-01-15 11:49:06.698 6795-6795 System.err com.telpo.cae W at java.lang.reflect.Constructor.newInstance0(Native Method) 2025-01-15 11:49:06.698 6795-6795 System.err com.telpo.cae W at java.lang.reflect.Constructor.newInstance(Constructor.java:343) 2025-01-15 11:49:06.698 6795-6795 System.err com.telpo.cae W at com.common.apiutil.pos.CommonUtil.<init>(CommonUtil.java:49) 2025-01-15 11:49:06.698 6795-6795 System.err com.telpo.cae W at com.telpo.cae.MainActivity.onCreate(MainActivity.kt:74) 2025-01-15 11:49:06.698 6795-6795 System.err com.telpo.cae W at android.app.Activity.performCreate(Activity.java:8022) 2025-01-15 11:49:06.698 6795-6795 System.err com.telpo.cae W at android.app.Activity.performCreate(Activity.java:8006) 2025-01-15 11:49:06.698 6795-6795 System.err com.telpo.cae W at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309) 2025-01-15 11:49:06.698 6795-6795 System.err com.telpo.cae W at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3404) 2025-01-15 11:49:06.698 6795-6795 System.err com.telpo.cae W at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3595) 2025-01-15 11:49:06.699 6795-6795 System.err com.telpo.cae W at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 2025-01-15 11:49:06.699 6795-6795 System.err com.telpo.cae W at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 2025-01-15 11:49:06.699 6795-6795 System.err com.telpo.cae W at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 2025-01-15 11:49:06.699 6795-6795 System.err com.telpo.cae W at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) 2025-01-15 11:49:06.699 6795-6795 System.err com.telpo.cae W at android.os.Handler.dispatchMessage(Handler.java:106) 2025-01-15 11:49:06.699 6795-6795 System.err com.telpo.cae W at android.os.Looper.loop(Looper.java:223) 2025-01-15 11:49:06.699 6795-6795 System.err com.telpo.cae W at android.app.ActivityThread.main(ActivityThread.java:7664) 2025-01-15 11:49:06.699 6795-6795 System.err com.telpo.cae W at java.lang.reflect.Method.invoke(Native Method) 2025-01-15 11:49:06.699 6795-6795 System.err com.telpo.cae W at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 2025-01-15 11:49:06.699 6795-6795 System.err com.telpo.cae W at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)