SDKManager is not initialized - Mini 3 crash
已完成Hello DJI Developer Support!
Info about our setup:
- MSDK version: v5.5.0
- DJI drone model: Mavic Mini 3
We've noticed the following issue appearing with above configuration:
Caused by java.lang.IllegalStateException: SDKManager is not initialized
at dji.v5.utils.common.ContextUtil.getContext(ContextUtil.java:2)
at dji.v5.manager.diagnostic.DeviceHealthManager.<init>(DeviceHealthManager.java:11)
at dji.v5.manager.diagnostic.DeviceHealthManager.<init>(DeviceHealthManager.java:1)
at dji.v5.manager.diagnostic.DeviceHealthManager$LazyHolder.<clinit>(DeviceHealthManager.java:1)
at dji.v5.manager.diagnostic.DeviceHealthManager$LazyHolder.co_a(DeviceHealthManager.java:1)
at dji.v5.manager.diagnostic.DeviceHealthManager.getInstance(DeviceHealthManager.java:1)
This does not happen immediately after calling:
DeviceHealthManager.getInstance().addDJIDeviceHealthInfoChangeListener
It just happens randomly after a couple of minutes when entering ground control station. I think there might be some stability issue with Mini 3 and that crash related to health info is only raised as the listener is still attached to it when it crashes.
We just tried to comment out the usage of DeviceHealthManager.getInstance() and now it crashes after a couple of minutes without even reporting a crash event to the Crashlytics!
-
I would like to inquire about the stability of the crash you mentioned. Is it consistently occurring? If so, could you please provide us with the steps to reproduce the crash?
Yes it is occurring consistently, but with a different rate. Sometimes it happens only after 1~2 minutes and another time it happens after 10 minutes. Not sure how would you try to repeat it, as there are many changes that we did from the stock UXSDK project.
According to the error message "SDKManager is not initialized", are you using other functions of the SDK after DJISDKInitEvent = INITIALIZE_COMPLETE?
Yes we are using many other functions and we're also checking for INITIALIZE_COMPLETE before registering app, e.g.:
if (event == DJISDKInitEvent.INITIALIZE_COMPLETE) {
// starts connection between DJI product and SDK
// https://developer.dji.com/api-reference/android-api/Components/SDKManager/DJISDKManager.html#djisdkmanager_startconnectiontoproduct_inline
SDKManager.getInstance().registerApp();
} -
Hello DJI Developer Support!
We're calling init method with registration callback:
SDKManager.getInstance().init(StartUpActivity.this, registrationCallback);
And that registration callback has the following logic to register app:
@Override
public void onInitProcess(DJISDKInitEvent event, int totalProcess) {
if (event == DJISDKInitEvent.INITIALIZE_COMPLETE) {
// starts connection between DJI product and SDK
// https://developer.dji.com/api-reference/android-api/Components/SDKManager/DJISDKManager.html#djisdkmanager_startconnectiontoproduct_inline
SDKManager.getInstance().registerApp();
}
}But we're still getting this issue.
-
Can you provide us with a stable reproduction method or a minimal project? Does it only occur consistently on certain devices? Does MSDK V5 sample also experience the same crash.? If you are willing to provide us with the minimum project that causes the crash, here is the upload address.:https://pan-sec.djicorp.com/s/5E2MGFZZ3cpEZcw -
Hello DJI Developer Support!
Sorry for late reply, will test it again today on the Mini 3 using the default UXSDK project and see if it crashes. But otherwise I never experienced this crash on M30T and M3T.
-
Currently, we are unable to determine the cause of the issue. Based on the crash logs, it appears that the problem is caused by the SDKManager not being initialized. Therefore, we would like to gather more information, such as whether there is a reliable way to reproduce the issue and if it only occurs on certain models of phones. -
Under what circumstances are you using `DeviceHealthManager.getInstance().addDJIDeviceHealthInfoChangeListener`? Could you provide us with the sequence of calls or this small portion of code? We will try to analyze it. If we cannot find a solution from it, I will have to wait for you to provide more information as we cannot reproduce the issue or find the cause from the logs. Here is the upload address where you can upload the file: https://pan-sec.djicorp.com/s/5E2MGFZZ3cpEZcw password:dji123
请先登录再写评论。
评论
17 条评论