Android Question DJI SDK Problems

javiman6969

Member
Licensed User
Longtime User
Hi!
This made an APP that runs on the Original DJI Tablet. This application must run together with the DJI Pilot application, but when I start the SDK, it gives me the following error:


*** Service (starter) Create ***
** Service (starter) Start **
java.lang.NoClassDefFoundError: Failed resolution of: Ldji/sdk/sdkmanager/DJISDKManager;
at anywheresoftware.b4a.objects.DJISDKManagerWrapper.Initialize(DJISDKManagerWrapper.java:54)
at aerodefectscan.axinfor.com.main._activity_create(main.java:416)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at aerodefectscan.axinfor.com.main.afterFirstLayout(main.java:105)
at aerodefectscan.axinfor.com.main.access$000(main.java:17)
at aerodefectscan.axinfor.com.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5282)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:966)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.sdk.sdkmanager.DJISDKManager" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/aerodefectscan.axinfor.com-1/base.apk"],nativeLibraryDirectories=[/data/app/aerodefectscan.axinfor.com-1/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 21 more
Suppressed: java.lang.ClassNotFoundException: dji.sdk.sdkmanager.DJISDKManager
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 22 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available



Is it possible to run both applications and make use of the SDK?
I would appreciate some information.
Thank you
 

javiman6969

Member
Licensed User
Longtime User
Hi Erel.
It also returns the same error!

java.lang.NoClassDefFoundError: Failed resolution of: Ldji/sdk/sdkmanager/DJISDKManager;


I am using the DJI CrystalSky tablet (Android 5.5) and is connect to CENDENCE Remote Control via USB C.
 
Upvote 0

John Calhoun

Member
Licensed User
Same error as above...any guidance would be appreciated.

Config:
B4A Version: 10.7
B4A Code: DJI Example.zip from https://www.b4x.com/android/forum/threads/dji-drones.75244/
B4A Library: DJI_library.zip from https://www.b4x.com/android/forum/threads/dji-drones.75244/ version 4.60
www.b4x.com/android/files/dji_additional.zip
DJI SDK: www.b4x.com/android/files/dji-sdk-4.14-trial1.aar (32/64 bit)
Android: v9 and v11
DJI Platform: Matrice 100
Other: https://www.b4x.com/android/files/Drone.apk produces same error

Logger connected to: Amazon KFSUWI
--------- beginning of crash
--------- beginning of system
--------- beginning of main
**************************** BaseApplication2 **************************
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Ldji/sdk/sdkmanager/DJISDKManager;
at anywheresoftware.b4a.objects.DJISDKManagerWrapper.Initialize(DJISDKManagerWrapper.java:54)
at b4a.dji2.b4xmainpage$ResumableSub_B4XPage_Created.resume(b4xmainpage.java:355)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1764)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5604)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:984)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.sdk.sdkmanager.DJISDKManager" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/b4a.dji2-2/base.apk", zip file "/system/priv-app/MetricsApi/MetricsApi.apk", zip file "/system/priv-app/com.amazon.dp.logger/com.amazon.dp.logger.apk"],nativeLibraryDirectories=[/data/app/b4a.dji2-2/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 25 more
Suppressed: java.lang.ClassNotFoundException: dji.sdk.sdkmanager.DJISDKManager
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 26 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
 
Upvote 0

John Calhoun

Member
Licensed User
Erel,

Thanks for the reply. I had not thought of that.

The Android device is an fairly old Amazon Fire 10 - will try my Galaxy Note 10.

Ok, here is what I got: Progress - which is great!

1) Added GetSupportedABIS Sub to example. Results:

Log(GetSupportedABIS) (Amazon Fire 10): (ArrayList) [armeabi-v7a, armeabi]

Log(GetSupportedABIS) (Galaxy Note 10): (ArrayList) [arm64-v8a, armeabi-v7a, armeabi]

2) Downloaded Drone.apk to Galaxy Note 10. Results:

Dron-Example did not crash but would not connect to Matrice (DJIHotpointMissionOperator failed to initialize)

Also, when I would plug the remote to the Note 10 it would ask if I wanted to run the Drone-Example on Inspire 1?

I have never gotten a drone-moldel specific message when connecting the remote controller to the Android devie.

3) Run Drone-Example from debugger on Galaxy Note 10

Logger connected to: Amazon KFSUWI
--------- beginning of crash
--------- beginning of system
--------- beginning of main
**************************** BaseApplication2 **************************
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Ldji/sdk/sdkmanager/DJISDKManager;
at anywheresoftware.b4a.objects.DJISDKManagerWrapper.Initialize(DJISDKManagerWrapper.java:54)
at b4a.dji2.b4xmainpage$ResumableSub_B4XPage_Created.resume(b4xmainpage.java:355)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:137)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1764)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5604)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:984)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.sdk.sdkmanager.DJISDKManager" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/b4a.dji2-2/base.apk", zip file "/system/priv-app/MetricsApi/MetricsApi.apk", zip file "/system/priv-app/com.amazon.dp.logger/com.amazon.dp.logger.apk"],nativeLibraryDirectories=[/data/app/b4a.dji2-2/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 25 more
Suppressed: java.lang.ClassNotFoundException: dji.sdk.sdkmanager.DJISDKManager
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 26 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Drone.apk will not run on the Amazon Fire as it doesn't include the 32 bit binary.
Start with the Galaxy Note 10 and drone.apk.

This message is expected. Have you also installed the DJI app on this device? Does it work? What happens if you uninstall the DJI app?
 
Upvote 0

John Calhoun

Member
Licensed User
I uninstalled DJI Go asppand reinstalled Drone.apk - still rthrowing DJIHotpointMissionOperator failed to initialize when select StartMission.
 
Upvote 0

John Calhoun

Member
Licensed User
Negative. No camera stream.

Here is what I did:

  1. Reinstalled DJI GO - connecting to the drone - camera stream.
  2. Uninstalled DJI GO.
  3. Installed Drone Example with apk
  4. Run Drone Example - not connecting to the drone - no camera stream

There is one difference in running the two apps. As per normal operation I connect the remote to the Note 10 after drone is powered up and connected to the remote. In both cases the Note 10 pops a window asking if I want to run DJI GO (or Drone Example). When running DJI GO once I choose to allow DJI GO to run the Note 10 opens DJI GO and connects to the drone showing camera stream. However, when I repeat the same sequence with the Drone Example, once I choose to allow the Drone Example to run, the app does not start.
 
Upvote 0

John Calhoun

Member
Licensed User
Turns out my camera cable was spotty - once I reseated it I am not able to get a vdioe stream from the Drone Example. The app connects to the drone for a short time and then disconnects. Here is the log file:

** Activity (main) Pause event (activity is not paused). **
**************************** BaseApplication2 **************************
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
Registered successfully!
activation state: UNKNOWN
binding state: UNKNOWN
onComponentChange: CAMERA
onComponentChange: GIMBAL
onComponentChange: FLIGHT_CONTROLLER
onComponentChange: BATTERY
onComponentChange: AIR_LINK
onComponentChange: REMOTE_CONTROLLER
Product connected
AfterAircraftConnected
simulator: true
C1 button: true
SDK_BindingStateChanged: NOT_SUPPORTED
Aircraft disconnected!
SDK_BindingStateChanged: NOT_SUPPORTED
Aircraft disconnected!
Activation state changed: NOT_SUPPORTED

Found someone on the forum recently with the same result:
https://www.b4x.com/android/forum/threads/dji-no-more-able-to-login.129358/

I tried your suggestion of "Install the DJI app and log in once. "

I will switch to the thread above and do some more research into the problem.

Thanks you!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…