Kotlin-BLE-Library icon indicating copy to clipboard operation
Kotlin-BLE-Library copied to clipboard

java.lang.NoSuchMethodException: no.nordicsemi.android.common.permissions.ble.viewmodel.PermissionViewModel.<init>

Open davehorner opened this issue 11 months ago • 1 comments

both app_server and app_client build but crash when run app_server I get:

2024-03-23 08:12:18.188 32625-32625 AndroidRuntime          no....android.kotlin.ble.app.server  E  FATAL EXCEPTION: main
                                                                                                    Process: no.nordicsemi.android.kotlin.ble.app.server, PID: 32625
                                                                                                    java.lang.RuntimeException: Cannot create an instance of class no.nordicsemi.android.common.permissions.ble.viewmodel.PermissionViewModel
                                                                                                    	at androidx.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.kt:201)
                                                                                                    Caused by: java.lang.NoSuchMethodException: no.nordicsemi.android.common.permissions.ble.viewmodel.PermissionViewModel.<init> []
                                                                                                    	at java.lang.Class.getConstructor0(Class.java:3325)
                                                                                                    	at java.lang.Class.getDeclaredConstructor(Class.java:3063)
                                                                                                    	at 

is there something I should do before building I'm missing?

davehorner avatar Mar 23 '24 17:03 davehorner

I got the same issue. I hope it will work after releasing new versions, as what fixed it for me was using the common library locally instead of from Maven Central. I still don't know why it was happening.

philips77 avatar Apr 23 '24 14:04 philips77