Skip to content

Implementation with kotlin #425

@LokoAddams

Description

@LokoAddams

0

Hi I'm Trying to use Connect SDK from LG to a proyect, too. I'm using kotlin like you. But I can set up my app I read the set up guide: https://connectsdk.com/en/latest/guide-and/and-discover-connect.html . But my program give me this error in the log cat of my device

2025-05-11 10:35:40.751  5515-5515  ziparchive              com.example.probandosdk              W  Unable to open '/data/data/com.example.probandosdk/code_cache/.overlay/base.apk/classes4.dm': No such file or directory
2025-05-11 10:35:40.752  5515-5515  ziparchive              com.example.probandosdk              W  Unable to open '/data/app/~~T95jDYSOKsTO6Mgyk_DKEg==/com.example.probandosdk-g4eG6ArOvBbce1JdAwhfUw==/base.dm': No such file or directory
2025-05-11 10:35:40.752  5515-5515  ziparchive              com.example.probandosdk              W  Unable to open '/data/app/~~T95jDYSOKsTO6Mgyk_DKEg==/com.example.probandosdk-g4eG6ArOvBbce1JdAwhfUw==/base.dm': No such file or directory
2025-05-11 10:35:41.028  5515-5515  nativeloader            com.example.probandosdk              D  Configuring clns-7 for other apk /data/app/~~T95jDYSOKsTO6Mgyk_DKEg==/com.example.probandosdk-g4eG6ArOvBbce1JdAwhfUw==/base.apk. target_sdk_version=35, uses_libraries=, library_path=/data/app/~~T95jDYSOKsTO6Mgyk_DKEg==/com.example.probandosdk-g4eG6ArOvBbce1JdAwhfUw==/lib/x86_64:/data/app/~~T95jDYSOKsTO6Mgyk_DKEg==/com.example.probandosdk-g4eG6ArOvBbce1JdAwhfUw==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.example.probandosdk
2025-05-11 10:35:41.029  5515-5515  CompatChangeReporter    com.example.probandosdk              D  Compat change id reported: 202956589; UID 10159; state: ENABLED
2025-05-11 10:35:41.044  5515-5515  GraphicsEnvironment     com.example.probandosdk              V  Currently set values for:
2025-05-11 10:35:41.044  5515-5515  GraphicsEnvironment     com.example.probandosdk              V    angle_gl_driver_selection_pkgs=[]
2025-05-11 10:35:41.044  5515-5515  GraphicsEnvironment     com.example.probandosdk              V    angle_gl_driver_selection_values=[]
2025-05-11 10:35:41.044  5515-5515  GraphicsEnvironment     com.example.probandosdk              V  Global.Settings values are invalid: number of packages: 0, number of values: 0
2025-05-11 10:35:41.044  5515-5515  GraphicsEnvironment     com.example.probandosdk              V  Neither updatable production driver nor prerelease driver is supported.
2025-05-11 10:35:41.077  5515-5515  CompatChangeReporter    com.example.probandosdk              D  Compat change id reported: 279646685; UID 10159; state: ENABLED
2025-05-11 10:35:41.111  5515-5515  TransactionExecutor     com.example.probandosdk              E  Failed to execute the transaction: tId:-893218533 ClientTransaction{
                                                                                                    tId:-893218533   transactionItems=[
                                                                                                    tId:-893218533     LaunchActivityItem{activityToken=android.os.BinderProxy@d183664,intent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.probandosdk/.MainActivity },ident=133277734,info=ActivityInfo{317ffce com.example.probandosdk.MainActivity},curConfig={1.0 310mcc260mnc [en_US] ldltr sw411dp w411dp h914dp 420dpi nrml long port night finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 - 1080, 2400) mAppBounds=Rect(0, 0 - 1080, 2400) mMaxBounds=Rect(0, 0 - 1080, 2400) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} as.3 s.55 fontWeightAdjustment=0},overrideConfig={1.0 310mcc260mnc [en_US] ldltr sw411dp w411dp h914dp 420dpi nrml long port night finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 - 1080, 2400) mAppBounds=Rect(0, 0 - 1080, 2400) mMaxBounds=Rect(0, 0 - 1080, 2400) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_0} as.3 s.2 fontWeightAdjustment=0},deviceId=0,referrer=com.android.shell,procState=2,state=null,persistentState=null,pendingResults=null,pendingNewIntents=null,sceneTransitionInfo=null,profilerInfo=null,assistToken=android.os.BinderProxy@fe80c93,shareableActivityToken=android.os.BinderProxy@65454d0,activityWindowInfo=ActivityWindowInfo{isEmbedded=false, taskBounds=Rect(0, 0 - 1080, 2400), taskFragmentBounds=Rect(0, 0 - 1080, 2400)}}
                                                                                                    tId:-893218533     ResumeActivityItem{mActivityToken=android.os.BinderProxy@d183664,procState=-1,updateProcState=false,isForward=true,shouldSendCompatFakeFocus=false}
                                                                                                    tId:-893218533     Target activity: Not found for token: android.os.BinderProxy@d183664
                                                                                                    tId:-893218533   ]
                                                                                                    tId:-893218533 }
2025-05-11 10:35:41.111  5515-5515  AndroidRuntime          com.example.probandosdk              D  Shutting down VM
2025-05-11 10:35:41.125  5515-5515  AndroidRuntime          com.example.probandosdk              E  FATAL EXCEPTION: main (Ask Gemini)
                                                                                                    Process: com.example.probandosdk, PID: 5515
                                                                                                    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.probandosdk/com.example.probandosdk.MainActivity}: java.lang.InstantiationException: java.lang.Class<com.example.probandosdk.MainActivity> cannot be instantiated
                                                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3954)
                                                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4235)
                                                                                                        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:112)
                                                                                                        at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:174)
                                                                                                        at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:109)
                                                                                                        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:81)
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2636)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:107)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:232)
                                                                                                        at android.os.Looper.loop(Looper.java:317)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8705)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
                                                                                                    Caused by: java.lang.InstantiationException: java.lang.Class<com.example.probandosdk.MainActivity> cannot be instantiated
                                                                                                        at java.lang.Class.newInstance(Native Method)
                                                                                                        at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
                                                                                                        at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:44)
                                                                                                        at android.app.Instrumentation.newActivity(Instrumentation.java:1448)
                                                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3941)
                                                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4235) 
                                                                                                        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:112) 
                                                                                                        at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:174) 
                                                                                                        at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:109) 
                                                                                                        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:81) 
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2636) 
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:107) 
                                                                                                        at android.os.Looper.loopOnce(Looper.java:232) 
                                                                                                        at android.os.Looper.loop(Looper.java:317) 
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:8705) 
                                                                                                        at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580) 
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886) 
2025-05-11 10:35:41.149  5515-5515  Process                 com.example.probandosdk              I  Sending signal. PID: 5515 SIG: 9

This is my code:

abstract class MainActivity : ComponentActivity() , ConnectableDeviceListener {
    private val mDiscoveryManager: DiscoveryManager? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        DiscoveryManager.init(applicationContext);

        val mDiscoveryManager: DiscoveryManager = DiscoveryManager.getInstance();
        mDiscoveryManager.start();
        enableEdgeToEdge()
        setContent {
            ProbandoSDKTheme {
                Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
                    Greeting(
                        name = "Android",
                        modifier = Modifier.padding(innerPadding)
                    )
                }
            }
        }
    }
}

I started to think this framework don't work well with kotlin, I don't know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions