1 like 0 dislike
92 views
in T20 by Q&A Freshman (108 points)

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)

Please log in or register to answer this question.

1 Answer

0 like 0 dislike
by Q&A Engineer (5.2k points)
Hello, about the LED function, plz refer the LedActivity.java in our demo. Select the LED type from COLOR_LED_1 to COLOR_LED_4, and select the LED color(just only GREEN_LED, RED_LED, YELLOW_LED)

Related questions

0 like 0 dislike
1 answer 822 views
0 like 0 dislike
1 answer 86 views
asked in T10 by yirien Q&A Freshman (102 points)
0 like 0 dislike
1 answer 32 views
asked in T20 by andres_enigoo_cz Q&A Freshman (102 points)
0 like 0 dislike
1 answer 679 views
0 like 0 dislike
1 answer 291 views
asked in T20 by akshayrajmane Q&A Freshman (102 points)
0 like 0 dislike
1 answer 693 views
asked in TPS900 by kigbu_ai Q&A Freshman (108 points)
0 like 0 dislike
1 answer 182 views
asked in T20 by jason Q&A Engineer (11.3k points)
0 like 0 dislike
1 answer 171 views
0 like 0 dislike
1 answer 226 views
Welcome to Telpo Q&A,

If you have a technical question ,please ask here, in English.

If you have faulty devices need be repaired,please create a issue ticket.

Please inquiry your ticket.

Notice :If you have an urgent question or cannot register account of Q&A, you can contact the online support in below jivochat .

Categories

...