How should I resolve the issue "java.lang.NoClassDefFoundError: Failed resolution of: Ldji/v5/manager/interfaces/SDKManagerCallback" ?

Follow

Comments

4 comments

  • quentin garwig

    Hello, I still have this issue too.I'am calling  com.secneo.sdk.Helper.install and tried to run init() on the main thread. Is it possible the the error come from the connection to the DJI AppKey ? What kind of erro does it provide ?  Here is mine. 

    FATAL EXCEPTION: main
                                                                                                        Process: com.example.msdksample, PID: 29312
                                                                                                        java.lang.NoClassDefFoundError: Failed resolution of: Ldji/v5/manager/interfaces/SDKManagerCallback;
                                                                                                            at java.lang.Class.newInstance(Native Method)




    0
    Comment actions Permalink
  • Alexandr Sah

    Hello, don't know if you've fixed your error already. I've started with the sample example here and was getting the same error - https://developer.dji.com/doc/mobile-sdk-tutorial/en/quick-start/user-project-caution.html
    What helped me was to move this line from MyApplication ( it can possible be any file ) into MainActivity inside onCreate method.

    SDKManager.getInstance().init(this,object: SDKManagerCallback {

    From the first glance, https://github.com/dji-sdk/Mobile-SDK-Android-V5/blob/dev-sdk-main/SampleCode-V5/android-sdk-v5-sample/src/main/java/dji/sampleV5/aircraft/DJIApplication.kt

    You can try and move line 23 - msdkManagerVM.initMobileSDK(this) into MainActivity .
    Hope it helps, GL

    0
    Comment actions Permalink
  • Csongor Varady
    If anyone is looking for a solution for this, check out the sample project from the DJI tutorial (https://developer.dji.com/doc/mobile-sdk-tutorial/en/quick-start/run-sample.html ).In that, the key to making this work is that the SDK is imported with a Lazy loading scheme (androidx.lifecycle.ViewModelLazy). The error arises because the SDK is imported too early in the execution, and this doesn't work with `com.secneo.sdk.Helper.install`.

    Copy the import from the sample project (see `GlobalVM.kt`, `MSDKManagerVM.kt` and `DJIApplication.kt`), and it should work.
    0
    Comment actions Permalink
  • Aaron Jasiewicz

    Csongor Varady Hey could you elaborate a bit more ? II am trying to make the V5 MSDK Sample run and keep getting that error 

    0
    Comment actions Permalink

Please sign in to leave a comment.

close