Unresolved reference: AirCraftManager in SDK V5
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:
- Unresolved reference: AirCraftManager
- The import dji.v5.manager.aircraft.AirCraftManager cannot be resolved
We have tried:
- Using different import paths
- Checking the official documentation
- Looking through sample code
Questions:
- What is the correct import path for AirCraftManager in SDK V5?
- Is there a different way to access the aircraft model name?
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.
°°°
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
°°°
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:
- Removed all references to AirCraftManager
- Implemented SDKManager as shown in the sample code
- 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.
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