dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
977 stars 580 forks source link

Errors when initializing Android DJI SDK 4.3.2 #170

Closed rusakovam closed 6 years ago

rusakovam commented 6 years ago

Hi,

Trying to registerAndroid DJI SDK by calling DJISDKManager.getInstance().registerApp(context, sdkManagerCallback);

And I get a bunch of error messages in console:

1)

W/System.err: java.lang.ClassNotFoundException: dji.pilot.reflect.AppPublicReflect

2)

E/DJIUsbAccessoryReceiver: start accessory receiver
E/NativeRcController: Couldn't load libusbdec.so

3)

W/System.err: javax.crypto.IllegalBlockSizeException: last block incomplete in decryption
W/System.err:     at com.android.org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(BaseBlockCipher.java:1104)
W/System.err:     at javax.crypto.Cipher.doFinal(Cipher.java:2056)
W/System.err:     at dji.midware.a.a.a.b(Unknown Source)
W/System.err:     at dji.internal.useraccount.LoginVerifyController.a(Unknown Source)
W/System.err:     at dji.internal.useraccount.LoginVerifyController.g(Unknown Source)
W/System.err:     at dji.internal.useraccount.LoginVerifyController.f(Unknown Source)
W/System.err:     at dji.internal.useraccount.LoginVerifyController.c(Unknown Source)
W/System.err:     at dji.internal.useraccount.LoginVerifyController$2.handleMessage(Unknown Source)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err:     at android.os.Looper.loop(Looper.java:154)
W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:61)

4)

E/o: Failed checkIsDJIBlocked Unable to resolve host "https://api.dji-services.com/api/v1/": No address associated with hostname

5)

E/SwUdpService: SwUdpConnect ...
E/step: step UDT.startup() start 1507656907433
E/step: step UDT.startup() end 1507656907437

6) And these errors repeat each 2 seconds continuously:

E/swudp-jni: SW_Pro_Gnd_Entry already start
E/SwUdpService: SwUdpConnect ...
E/swudp-jni: SW_Pro_Gnd_Entry already start
E/SwUdpService: SwUdpConnect ...
E/swudp-jni: SW_Pro_Gnd_Entry already start
E/SwUdpService: SwUdpConnect ...
E/swudp-jni: SW_Pro_Gnd_Entry already start
E/SwUdpService: SwUdpConnect ...

The whole code snippet is:

DJISDKManager.SDKManagerCallback sdkManagerCallback = new DJISDKManager.SDKManagerCallback() {
    @Override
    public void onRegister(DJIError error) {
        Log.d(TAG, "DJISDKManager.SDKManagerCallback.onRegister(): " + error.getDescription());
        if(error == REGISTRATION_SUCCESS) {
                DJISDKManager.getInstance().startConnectionToProduct();
        }
    }

    @Override
    public void onProductChange(BaseProduct oldProduct, BaseProduct newProduct) {
        Log.d(TAG, "DJISDKManager.SDKManagerCallback.onProductChange() " + oldProduct + " -> " + newProduct);
    }
};

DJISDKManager.getInstance().registerApp(context, sdkManagerCallback);

Permissions are granted.

The most confusing thing is that with all this error output the aircraft seems to connect! I get all callbacks, the product instance, etc.

Anyway, these errors look quite confusing. Please help me to investigate.

DJI SDK 4.3.2 Android 7.0

talobin commented 6 years ago

@rusakovam Which Android device are you using? Are you getting these error using our sample app?

kwong93 commented 6 years ago

Same here, functionally I can use the drone and sdk features, but it keeps logging the same error, here is some of the trace: Using s7, android version 6.0.1, dji sdk 4.3.2

D/FPVController: try to load libdjivideo.so
D/Lightbridge: load interface in register_DJICamController()
D/Lightbridge: loaded DJIVideoJNI.cpp :JNI_OnLoad() go to end
W/System.err: java.lang.ClassNotFoundException: dji.pilot.reflect.AppPublicReflect
W/System.err:     at dji.midware.data.manager.a.b.f(Unknown Source)
W/System.err:     at dji.midware.data.manager.a.b.g(Unknown Source)
W/System.err:     at dji.midware.data.manager.a.b.<init>(Unknown Source)
W/System.err:     at dji.midware.data.manager.a.b.<clinit>(Unknown Source)
W/System.err:     at dji.midware.data.manager.a.b.getInstance(Unknown Source)
W/System.err:     at dji.midware.usbhost.P3.NativeRcController.<clinit>(Unknown Source)
W/System.err:     at dji.midware.usbhost.P3.NativeRcController.getIsP4pPAD(Unknown Source)
W/System.err:     at dji.midware.link.a.a(Unknown Source)
W/System.err:     at dji.midware.link.a$1.handleMessage(Unknown Source)
W/System.err:   Suppressed: java.lang.ClassNotFoundException: dji.pilot.reflect.AppPublicReflect
I/DJIProductManager: lType=Tomato lrcType=litchiX
I/DJIProductManager: DJIProductManager register
E/DJIUsbAccessoryReceiver: start accessory receiver
D/DJIComponentManager: DataEvent = ConnectLose
D/DJIComponentManager: Wed Oct 18 16:03:49 CDT 2017updateValue
D/DJIFlycParamInfoManager: readToMemory size = 673
D/DJISDKCacheHWAbstractionLayer:  ========================
                                 2017-10-18 16:03:50.012
                                  ========================

D/DJISDKCacheHWAbstractionLayer:  ========================
                                 2017-10-18 16:03:50.068
                                  Product : a
                                  ========================

I/DJISDKCacheHWAbstractionLayer: addCameraAbstraction None None
D/DJISDKCacheHWAbstractionLayer:  ========================
                                 2017-10-18 16:03:50.139
                                  Product : a
                                  RemoteController : b
                                  ========================

E/o: Failed checkIsDJIBlocked Unable to resolve host "https://api.dji-services.com/api/v1/": No address associated with hostname
W/System.err:     at dji.midware.a.a.a.b(Unknown Source)
W/System.err:     at dji.internal.useraccount.LoginVerifyController.a(Unknown Source)
W/System.err:     at dji.internal.useraccount.LoginVerifyController.g(Unknown Source)
W/System.err:     at dji.internal.useraccount.LoginVerifyController.f(Unknown Source)
W/System.err:     at dji.internal.useraccount.LoginVerifyController.c(Unknown Source)
W/System.err:     at dji.internal.useraccount.LoginVerifyController$2.handleMessage(Unknown Source)
D/nfz: flysafe_areas_djisdk.db
...

// it keeps repeating the below two lines

E/swudp-jni: SW_Pro_Gnd_Entry already start
E/SwUdpService: SwUdpConnect ...
talobin commented 6 years ago

@rusakovam @kwong93 We do keep some important log even in release version. It is so we can debug a crash or failure when they do happen. Some of them might also be helpful to some user. They are not necessarily bad things. If the SDK is working, you don't have to worry. You could filter them out if it gets too busy.

mordka commented 6 years ago

Hi I'm running SDK 4.5 and during registerApp() I'm getting the following exception. Sometime's product registration works but when this error happens sdk is useless.

W/System.err: javax.crypto.IllegalBlockSizeException: last block incomplete in decryption
        at com.android.org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(BaseBlockCipher.java:1143)
        at javax.crypto.Cipher.doFinal(Cipher.java:1736)
        at dji.midware.a.a.a.b(Unknown Source:31)
        at dji.internal.useraccount.LoginVerifyController.a(Unknown Source:7)
        at dji.internal.useraccount.LoginVerifyController.h(Unknown Source:16)
        at dji.internal.useraccount.LoginVerifyController.g(Unknown Source:0)
        at dji.internal.useraccount.LoginVerifyController.e(Unknown Source:0)
        at dji.internal.useraccount.LoginVerifyController$2.handleMessage(Unknown Source:46)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.os.HandlerThread.run(HandlerThread.java:65)