Android Question DJI app crashing on new device

Status
Not open for further replies.

shb777

Active Member
Licensed User
Longtime User
My Nvidia Shield battery crapped out, so I bought a Galaxy Tab S3 to replace it running my DJI app.
But now the app always crashes on this line.

B4X:
sdk.Initialize("sdk")  '  this is crashing  app

Another problem I'm having, is when I power up the remote and drone, the S3 asks me if I want to use DJI Go 4 or my app, but it doesn't give me the option of using it just once, it always makes my choice the default. Steve
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should check the logs and find the error message.

the S3 asks me if I want to use DJI Go 4 or my app, but it doesn't give me the option of using it just once, it always makes my choice the default. Steve
This is a known (Android) issue on some devices. The only way to remove this dialog is by uninstalling DJI Go app.
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
here's the log. of course the drone is not connected because the tablet is connected to the pc.



Logger connected to: samsung SM-T820
--------- beginning of main
**************************** BaseApplication **************************
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
main_activity_resume (java line: 763)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean dji.sdk.sdkmanager.DJISDKManager.hasSDKRegistered()' on a null object reference
at anywheresoftware.b4a.objects.DJISDKManagerWrapper.getRegistered(DJISDKManagerWrapper.java:87)
at b4a.dji.waldo.main._activity_resume(main.java:763)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at b4a.dji.waldo.main.afterFirstLayout(main.java:110)
at b4a.dji.waldo.main.access$000(main.java:17)
at b4a.dji.waldo.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6780)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
(NullPointerException) java.lang.NullPointerException: Attempt to invoke virtual method 'boolean dji.sdk.sdkmanager.DJISDKManager.hasSDKRegistered()' on a null object reference
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/Gson;
at dji.thirdparty.retrofit2.converter.gson.GsonConverterFactory.create(Unknown Source)
at dji.internal.network.f.<init>(Unknown Source)
at dji.internal.network.f.getInstance(Unknown Source)
at dji.internal.network.e.<init>(Unknown Source)
at dji.internal.network.e$a.<clinit>(Unknown Source)
at dji.internal.network.e$a.a(Unknown Source)
at dji.internal.network.e.getInstance(Unknown Source)
at dji.internal.analytics.DJIAnalyticsEngine.init(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source)
at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.gson.Gson" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/b4a.dji.waldo-1/base.apk", zip file "/data/user/0/b4a.dji.waldo/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/b4a.dji.waldo-1/lib/arm64, /system/fake-libs64, /data/app/b4a.dji.waldo-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 13 more
--------- beginning of crash
** Activity (main) Pause, UserClosed = true **
No wakelock.
sending message to waiting queue (sleep)
sending message to waiting queue (sleep)
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
yes, I'm using DJI library v4.41, and dji-sdk-4.4.1.aar is in my extra libraries folder, and I'm running 8.3
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
here's the project. Would this cause the crash "Didn't find class "com.google.gson.Gson" "
 

Attachments

  • waldo exported 7-3.zip
    110.6 KB · Views: 286
Upvote 0

shb777

Active Member
Licensed User
Longtime User
I ran the dronemission example, and it crashed, even when I was connected to the drone. I'm running Android 7.0, Nougat. DJI go 4 is saying I need a firmware update, but that shouldn't matter, should it? So maybe my tablet doesn't like the DJI SDK?

here's the log from the dronemission crash


Logger connected to: samsung SM-T820
--------- beginning of main
**************************** BaseApplication **************************
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (activity_permissionresult)
running waiting messages (1)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (activity_permissionresult)
running waiting messages (1)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (activity_permissionresult)
running waiting messages (1)
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/Gson;
at dji.thirdparty.retrofit2.converter.gson.GsonConverterFactory.create(Unknown Source)
at dji.internal.network.f.<init>(Unknown Source)
at dji.internal.network.f.getInstance(Unknown Source)
at dji.internal.network.e.<init>(Unknown Source)
at dji.internal.network.e$a.<clinit>(Unknown Source)
at dji.internal.network.e$a.a(Unknown Source)
at dji.internal.network.e.getInstance(Unknown Source)
at dji.internal.analytics.DJIAnalyticsEngine.init(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source)
at java.lang.Thread.run(Thread.java:762)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.gson.Gson" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/b4a.dji.test1-1/base.apk", zip file "/data/user/0/b4a.dji.test1/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/b4a.dji.test1-1/lib/arm64, /data/app/b4a.dji.test1-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 13 more
--------- beginning of crash
** Activity (main) Pause, UserClosed = true **
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
DJI go 4 is saying I need a firmware update, but that shouldn't matter, should it?
No.

Try this:
- Download the attached jar and copy it to the additional libraries folder.
- Add: #AdditionalJar: gson-2.8.2

What happens when you run it?
 

Attachments

  • gson-2.8.2.jar
    227.5 KB · Views: 289
Upvote 0

shb777

Active Member
Licensed User
Longtime User
I did this. Drone Mission still crashed, but my app didn't crash when it wasn't connected to the drone, because drone mission was the default app. But it got no video
or telemetry. When I cleared drone mission from being the default, then my app crashed. Should I concentrate on getting drone mission working, and forget about my app,
for the time being?

I tried drone mission on my phone and it crashed. But DJI Go 4 works on that phone.
 
Last edited:
Upvote 0

shb777

Active Member
Licensed User
Longtime User
I don't know what you mean by "Might be an issue with how your phone handles the multidex feature." the phone works with dji go 4. is mission drone working with your
drone and other peoples drones?

here's the log on my phone crash:

Logger connected to: HUAWEI RNE-L22
--------- beginning of main
--------- beginning of system
**************************** BaseApplication **************************
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
--------- beginning of crash
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/wire/Message;
at com.dji.service.areacode.DJIAreaCodeManger.o(Unknown Source:16)
at com.dji.service.areacode.DJIAreaCodeManger.a(Unknown Source:28)
at dji.sdksharedlib.a.a(Unknown Source:12)
at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown Source:22)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:108)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source:0)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:90)
at java.lang.Thread.run(Thread.java:784)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.squareup.wire.Message" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/b4a.dji.test1-8yU2Gn4ca3WJ_eFYbi9zrQ==/base.apk", zip file "/data/user/0/b4a.dji.test1/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/b4a.dji.test1-8yU2Gn4ca3WJ_eFYbi9zrQ==/lib/arm64, /data/app/b4a.dji.test1-8yU2Gn4ca3WJ_eFYbi9zrQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 8 more
** Activity (main) Pause, UserClosed = true **
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

shb777

Active Member
Licensed User
Longtime User
yes. So it seems there must be something wrong with my configuration. java sdk, android sdk or my libraries, right? maybe I should do a clean install.

I'm currently using \jdk1.8.0_112 and C:\android-sdk\platforms\android-25\android.jar


this seems to be the latest: jdk-8u172-windows-x64.exe should I be using it?
 
Last edited:
Upvote 0

shb777

Active Member
Licensed User
Longtime User
I did a new install of B4A 8.0 will all new java and android via this page. https://www.b4x.com/b4a.html

drone mission still crashed. here's the log
Logger connected to: samsung SM-G600FY
--------- beginning of main
--------- beginning of system
**************************** BaseApplication **************************
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/dji/service/areacode/wire/DJIACCityListModel;
at com.dji.service.areacode.d.a(Unknown Source)
at com.dji.service.areacode.d.a(Unknown Source)
at com.dji.service.areacode.d.a(Unknown Source)
at com.dji.service.areacode.DJIAreaCodeManger.a(Unknown Source)
at com.dji.service.areacode.DJIAreaCodeManger.a(Unknown Source)
at com.dji.service.areacode.DJIAreaCodeManger$e$1.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.dji.service.areacode.wire.DJIACCityListModel" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/b4a.dji.test1-2/base.apk", zip file "/data/data/b4a.dji.test1/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/b4a.dji.test1-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)
... 9 more
Suppressed: java.lang.NoClassDefFoundError: com.dji.service.areacode.wire.DJIACCityListModel
at dalvik.system.DexFile.defineClassNative(Native Method)
at dalvik.system.DexFile.defineClass(DexFile.java:226)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
at dalvik.system.DexPathList.findClass(DexPathList.java:321)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
... 11 more
Suppressed: java.lang.ClassNotFoundException: com.dji.service.areacode.wire.DJIACCityListModel
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)
... 10 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
** Activity (main) Pause, UserClosed = true **
sending message to waiting queue (sdk_registeredresult)
activation listener added
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
These are the DJI libraries in my extra libraries folder. Does this look right?


dji-uilibrary-4.4.1.aar
djiui_native.jar
djiui.aar
dji-sdk-provided-4.4.1.jar
dji-sdk-4.4.1.aar
dji_native.jar
DJI.xml
DJI.jar
dji.aar
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
When I downloaded the drone mission, I didn't change the app key or package name. When I changed them to my values, I'm getting this:

The app key submitted is invalid. Please check the app key you provided.

They both look right and I just copied and pasted the app key.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
When I downloaded the drone mission, I didn't change the app key or package name. When I changed them to my values, I'm getting this:

The app key submitted is invalid. Please check the app key you provided.

They both look right and I just copied and pasted the app key.
So the class not found exceptions were resolved?
 
Upvote 0
Status
Not open for further replies.
Top