Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] crash :ChipDeviceControllerException constructor not found #29039

Closed
netscell opened this issue Sep 3, 2023 · 3 comments · Fixed by #29066
Closed

[BUG] crash :ChipDeviceControllerException constructor not found #29039

netscell opened this issue Sep 3, 2023 · 3 comments · Fixed by #29066
Assignees
Labels
android bug Something isn't working needs triage

Comments

@netscell
Copy link

netscell commented Sep 3, 2023

Reproduction steps

call pair device,throw ChipDeviceControllerException and android app crashed:

the android crash log:
java.lang.NoSuchMethodError: no non-static method "Lchip/devicecontroller/ChipDeviceControllerException;.(ILjava/lang/String;)V"
at chip.devicecontroller.ChipDeviceController.pairDevice(Native Method)
at chip.devicecontroller.ChipDeviceController.pairDevice(ChipDeviceController.java:160)
at chip.devicecontroller.ChipDeviceController.pairDevice(ChipDeviceController.java:129)

the ThrowError in JniReferences.cpp get method is :
jmethodID constructor = env->GetMethodID(exceptionCls, "", "(ILjava/lang/String;)V");
but in ChipDeviceControllerException.java constructor param errorCode type is long,not int;

Bug prevalence

1-2times a day

GitHub hash of the SDK that was being used

sdk version 1.0.0.2

Platform

android

Platform Version(s)

No response

Anything else?

No response

@yunhanw-google
Copy link
Contributor

@netscell
this issue should be fixed by #26802
please use the latest code, thanks

@joonhaengHeo
Copy link
Contributor

joonhaengHeo commented Sep 4, 2023

@yunhanw-google
Some code is still in use as JniReference::GetInstance().ThrowError() function.

err = JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipDeviceControllerException",

JniReferences::GetInstance().ThrowError(env, sChipDeviceControllerExceptionCls, err);

@yunhanw-google
Copy link
Contributor

yunhanw-google commented Sep 4, 2023

yep, agree, ThrowError is still problematic to handle the error with uint32_t, let's fix that, thanks
Let's continue to track this overall effort under #28673, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working needs triage
Projects
Archived in project
4 participants