Closed jknair0 closed 6 years ago
FATAL EXCEPTION: main
Process: com.sensehawk.link, PID: 31385
java.lang.NullPointerException: Attempt to invoke virtual method 'dji.midware.data.config.P3.ProductType dji.midware.data.manager.P3.DJIProductManager.c()' on a null object reference
at dji.midware.media.e.c.b.a(Unknown Source)
at dji.midware.media.e.c.b.a(Unknown Source)
at dji.sdk.camera.view.FpvLiveView.surfaceCreated(Unknown Source)
at android.view.SurfaceView.updateWindow(SurfaceView.java:720)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:215)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1014)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2620)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1544)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7613)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:622)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7409)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
I have got the same crash with the FPVOverlayWidget
and FPVWidget
using dji ui library 4.3.2
Also with dji.sdk.camera.view.CameraLiveView
I havent connected to any drone.
@jayakrishnan1236 @oliverou @talobin I am also having this exact some issue when following the tutorials.
However, when I remove the FPVOverlayWidget
and FPVWidget
the application runs successfully.
Okay, so upon further investigation, it looks like this only happens when you run the app and do not have the phone connected to the R/C controller.
No it happens when you are not registered to dji sdk. DJISDKManager#registerApp
. Before you inflating the view onto screen, register with the SDK , it wont happen. However, SDK should handle this sort of situation instead of crashing. @ZeroCool2u
@jayakrishnan1236 Oh, I suppose that makes sense why it works on my Pixel XL, but not the emulator then. The emulator does successfully register eventually, but it definitely takes longer than the physical device.
Do you have any information about how to force the registration prior to inflating the view? Do you just have to make sure that the view with the FPV widgets is not the default at launch?
Yes i am doing so. I am making sure that it registers in one screen an inflates in other.
@jayakrishnan1236 Thanks for the suggestion, that's what we ended up doing as well. Later on though, we had to change the design of the app to enable usage between the different activities. We used the Google Maps example that shows how to register the SDK using the Application Class, which is not something that is typically done by most apps. However, it does seem to be the best option for apps that need SDK access in multiple activities.
Closing this issue since it should be fixed with 4.4.1. Please feel free to reopen if problem occurs again.
When i am using this in my activity onCreate() the app crashs
I am using android studio 2.3.3 dji sdk 4.3.2