New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String Resource ID #0x0 Not Found when reconnecting P4 (SDK 3.5.1) #64
Comments
Hi @RPSpicer - this looks like a duplicate of #58 and #49. I've provided a solution for this previously to make debugging easier for both us and DJI - as an update, I've added an MIT license to the code snippet and the affected classes that could be changed to prevent crashes like this in the future. (can't reasonably open a PR against the SDK binary) https://gist.github.com/jtuchek/3d8ec17a26d4a3f650652542c229b04a |
@jtuchek Thank you! Is there a sneaky way to monkeypatch the compiled SDK, or are we stuck dealing with this until DJI fixes the resource on their end? (I'll leave this open until someone from DJI closes it -- want to make sure it's known to them, as it's causing me some heartburn. |
@RPSpicer ehhh, not really. It's not very developer friendly because it isn't open source. At least not without re-compiling the SDK, doing raw byte-code manipulation, or some class loader hackery that I'm unaware of. |
@jtuchek Thank you! That's what I thought, just figured I'd ask in case there was some Java ninja-ery I didn't know about. @oliverou and other DJI folks: Please take a look at fixing this in the next release? Random crashes during signal dropouts are not acceptable to my end-users! |
Is there an update or fix coming out for this issue? This issue has been open for nearly a month, and the root cause is the source of probably 4-5 other issues reported in the tracker. |
Hi @jtuchek, @RPSpicer, sorry for the late reply. We have investigated the issue and provide the following solution for you to try: Please add the following content at the bottom of the sdk_strings.xml files in both values and values-zh-rCN folders in the "DJI-SDK-LIB/res/values" path as shown below (Above the sdk_strings.xml in "values-zh-rCN" folder:
sdk_strings.xml in "values" folder:
Hope this help! |
Hi @oliverou There's a few more missing (reported from the build tool). There's a Chinese resource for So in any other Locale, if trying to use those resources it would cause any app using the SDK to crash. |
Hi @jtuchek, thanks for the feedbacks, here are the related English resource you mention above:
Please add these to sdk_strings.xml in "values" folder. |
@jtuchek could you try with the latest SDK's AAR and see if the issue is fixed for you? |
Will go ahead and close this ticket as current version (4.3.2) should have a fix for this already. |
Description of Issue:
I am running the DJI SDK 3.5.1 on a Google (HTC) Nexxus 9 running Android 7.0. When I turn off and then turn on my Phantom 4 to simulate loss of signal, my app crashes with the following stack trace just after the DJIBaseProduct setup stuff finishes printing the reconnection info (update battery platformType and etc) to ADB:
E/AndroidRuntime: FATAL EXCEPTION: Thread-452
Process: name.ryanspicer.flightplanner, PID: 9234
android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.content.res.Resources.getText(Resources.java:331)
at android.content.res.Resources.getString(Resources.java:377)
at dji.midware.g.a.a(Unknown Source)
at dji.midware.g.a.b(Unknown Source)
at dji.sdk.util.Util.getString(Unknown Source)
at dji.internal.c.j.a(Unknown Source)
at dji.internal.c.g.a(Unknown Source)
at dji.sdk.base.DJIBaseProduct$1.onDiagnosisUpdate(Unknown Source)
at dji.internal.c.f.c(Unknown Source)
at dji.internal.c.m.onSuccess(Unknown Source)
at dji.midware.data.manager.P3.u.callbackSuccess(Unknown Source)
at dji.midware.data.manager.P3.u.access$200(Unknown Source)
at dji.midware.data.manager.P3.w.run(Unknown Source)
at java.lang.Thread.run(Thread.java:761)
This seems to occur any time I have an established connection with the P4, then disconnect, then reconnect. It's unclear to me whether it's caused by the power-cycle or the loss of signal (since I have no way to simulate weak signal conditions aside from carrying my RC away from the P4, in which case I don't have ADB connected to catch the crash log).
To reproduce:
The text was updated successfully, but these errors were encountered: