Mobile-SDK-Android-V5 icon indicating copy to clipboard operation
Mobile-SDK-Android-V5 copied to clipboard

Unresolved reference: AirCraftManager in SDK V5

Open Superdani43 opened this issue 10 months ago • 3 comments

Title: Unresolved reference: AirCraftManager in SDK V5

We are experiencing issues with unresolved references when trying to access the AirCraftManager in DJI SDK V5.

Environment:

  • Android Studio: Koala 2024.1.1
  • DJI SDK Version: 5.12.0
  • compileSdk: 34
  • targetSdk: 34
  • Java Version: 17

Dependencies in build.gradle: gradle compileOnly 'com.dji:dji-sdk-v5-aircraft-provided:5.12.0' implementation 'com.dji:dji-sdk-v5-aircraft:5.12.0' implementation 'com.dji:dji-sdk-v5-networkImp:5.12.0'

Code: kotlin import dji.v5.manager.aircraft.AirCraftManager fun getProductName(): String { return AirCraftManager.getInstance().model?.name ?: "Unknown Aircraft" }

Errors:

  1. Unresolved reference: AirCraftManager
  2. The import dji.v5.manager.aircraft.AirCraftManager cannot be resolved

We have tried:

  1. Using different import paths
  2. Checking the official documentation
  3. Looking through sample code

Questions:

  1. What is the correct import path for AirCraftManager in SDK V5?
  2. Is there a different way to access the aircraft model name?

Superdani43 avatar Jan 26 '25 23:01 Superdani43

Agent comment from Leon in Zendesk ticket #128095:

Hello, sorry to have kept you waiting for so long. As the Spring Festival holiday is approaching, the relevant engineers are on vacation. We have recorded your question and will contact you as soon as possible after the engineer's vacation. We apologize for the inconvenience caused to you.

°°°

dji-dev avatar Jan 27 '25 03:01 dji-dev

Agent comment from SHENRONG.LE in Zendesk ticket #128095:

Dear Developer,

Hello and thank you for reaching out to DJI Innovations.

I noticed that AirCraftManager is not a class in the sample code, this error may be related to your local environment and configuration, can you use the sample code to run the installation? https://developer.dji.com/doc/mobile-sdk-tutorial/cn/quick-start/run-sample.html

We hope that our solution meets your needs satisfactorily. We appreciate your email and wish you a wonderful day!

Best Regards, DJI Innovations SDK Technical Support Team

°°°

dji-dev avatar Jan 29 '25 06:01 dji-dev

Comentario del agente de SHENRONG. LE en Zendesk ticket #128095:Estimado desarrollador,

Hola y gracias por ponerte en contacto con DJI Innovations.

Me di cuenta de que AirCraftManager no es una clase en el código de muestra, este error puede estar relacionado con su entorno y configuración locales, ¿puede usar el código de muestra para ejecutar la instalación? https://developer.dji.com/doc/mobile-sdk-tutorial/cn/quick-start/run-sample.html

Esperamos que nuestra solución satisfaga sus necesidades de manera satisfactoria. ¡Agradecemos su correo electrónico y le deseamos un maravilloso día!

Saludos cordiales, equipo de soporte técnico de DJI Innovations SDK

°°°

Following your response about AirCraftManager not being a class in the sample code, we have:

  1. Removed all references to AirCraftManager
  2. Implemented SDKManager as shown in the sample code
  3. Followed the exact structure from: https://developer.dji.com/doc/mobile-sdk-tutorial/cn/quick-start/run-sample.html

New Issue

After implementing these changes, we're encountering a new error with SDKManager: logcat java.lang.VerifyError: Verifier rejected class dji.v5.manager.SDKManager: void dji.v5.manager.SDKManager.() failed to verify: void dji.v5.manager.SDKManager.(): [0x0] Constructor returning without calling superclass constructor

Environment

  • DJI SDK Version: 5.12.0
  • Android Studio Version: Latest
  • Kotlin Version: 1.8.10 (as recommended)
  • CompileSdk: 33
  • TargetSdk: 33
  • Java Version: 17
  • Test Device: DJI RC Pro
  • Drone Model: Mavic 3M

Current Implementation

Following exactly the sample code structure, using SDKManager instead of AirCraftManager as suggested.

Code Configuration

build.gradle (app level): gradle dependencies { implementation('com.dji:dji-sdk-v5-aircraft:5.12.0') { exclude group: 'com.android.support' } implementation('com.dji:dji-sdk-v5-networkImp:5.12.0') { exclude group: 'com.android.support' } implementation('com.dji:dji-sdk-v5-aircraft-provided:5.12.0') { exclude group: 'com.android.support' } }

Question

Now that we're following the sample code exactly but still encountering this verification error in the SDKManager constructor, what additional steps should we take to resolve this issue?

Additional Context

  • We've verified our implementation matches the sample code
  • The error occurs consistently on every launch attempt
  • All previous suggestions have been implemented

Superdani43 avatar Jan 29 '25 11:01 Superdani43