Android Question dji app crashing

Discussion in 'Android Questions' started by shb777, Aug 13, 2018.

Tags:
  1. shb777

    shb777 Active Member Licensed User

    When I run Erel's drone mission, or my DJI app, connected to my drone, it always crashes the first time, then runs OK, usually the 2nd time, sometimes the third time. Any ideas why this would happen?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You need to post the error message from the logs.
     
  3. shb777

    shb777 Active Member Licensed User

    but there's not gonna be an error message because i'm only running from my tablet. I'm running in release mode. I expect the app to crash when I'm not connected to the drone. Should I be using the Simulator or something else?
     
    Last edited: Aug 14, 2018
  4. shb777

    shb777 Active Member Licensed User

    I'm writing your logs to a label on the app, and it's crashing in SDK_ProductChanged, saying no connected product. But the remote is saying it's connected, and giving the
    correct battery level. Just now, after saying no connected product, it said product connected, and has been showing video and telemetry for a long time. So I'm assuming that even if SDK_ProductChanged returns no data, the app should keep running waiting for SDK_ProductChanged to be called again with data.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Make sure that bridge logger is enabled:
    Code:
    #BridgeLogger: True
    You should run the app connected with B4A-Bridge and post the error message from the logs.
     
  6. shb777

    shb777 Active Member Licensed User

    but the tablet has to be connected to the remote control, so it can't be connected to the pc except maybe via wifi. is that what you mean? I do have
    Code:
    #bridgelogger True
     
    Last edited: Aug 15, 2018
  7. DonManfred

    DonManfred Expert Licensed User

    The tablet is connected to the remotecontrol over usb cable or not?
    And the tablet can use wifi to use b4a bridge to install the app from your pc

    Your PC is then able to get the log over b4a bridge
     
    Last edited: Aug 15, 2018
  8. shb777

    shb777 Active Member Licensed User

    yes the tablet has to be connected to the remote control via cable when i'm testing my app. i typically don't use wifi to connect via the bridge because it was unreliable
     
  9. shb777

    shb777 Active Member Licensed User

    This morning I was running the exact same project that was running OK last night, and it was crashing. Now, after leaving the tablet on for a while, and maybe the drone
    and remote control have warmed up a little, it's running OK. Typically, when I fly the drone, I don't worry about having things "warm up".

    Actually, my program is almost exactly like drone mission now. I'm re writing it, and have
    only added mapfragment, and a few labels.
     
    Last edited: Aug 16, 2018
  10. shb777

    shb777 Active Member Licensed User

    I've found that when I take the mapfragment out with the designer my app doesn't crash. when it's in it crashes. i haven't changed any code at all.
     
  11. shb777

    shb777 Active Member Licensed User

    Does this look correct for my manifest


    Code:
    '************ Google Play Services Base ************
    AddApplicationText(
       <
    activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
      android:theme=
    "@android:style/Theme.Translucent.NoTitleBar"
      android:exported=
    "false"/>
        <meta-data
      android:name=
    "com.google.android.gms.version"
      android:value=
    "@integer/google_play_services_version" />
    )
    '************ Google Play Services Base (end) ************
     
  12. shb777

    shb777 Active Member Licensed User

    I put gmap in drone mission and it's crashing. Here's the project.
     

    Attached Files:

  13. Erel

    Erel Administrator Staff Member Licensed User

    You need to be able to see the logs. You will not be able to develop without them.
     
  14. shb777

    shb777 Active Member Licensed User

    how do I do that?
     
  15. DonManfred

    DonManfred Expert Licensed User

    See post #5
     
  16. shb777

    shb777 Active Member Licensed User

    I did what you said here's the log:


    Logger connected to: samsung SM-T820
    --------- beginning of main
    **************************** BaseApplication **************************
    **************************** BaseApplication **************************
    *** Service (starter) Create ***
    ** Service (starter) Start **
    ** Activity (main) Create, isFirst = true **
    ** Activity (main) Resume **
    activation listener added
    Registered successfully!
    activation state: UNKNOWN
    binding state: UNKNOWN
    No connected product
    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:154)
    at android.os.HandlerThread.run(HandlerThread.java:61)
    Caused by: java.lang.ClassNotFoundException: com.dji.service.areacode.wire.DJIACCityListModel
    at java.lang.VMClassLoader.findLoadedClass(Native Method)
    at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 9 more
    Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/wire/Message;
    ... 9 more
    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.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, /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)
    ... 9 more
    --------- beginning of crash
    ** Activity (main) Pause, UserClosed = true **
    sending message to waiting queue (sdk_productchanged)
    sending message to waiting queue (sdk_activationstatechanged)
     
  17. Erel

    Erel Administrator Staff Member Licensed User

    That's better. Are you using an Android 5+ device? Might be a multidex issue.
     
  18. shb777

    shb777 Active Member Licensed User

    yes it's a new tablet. it runs 7 or 8. what should i do? do i need to add this
    Code:
    #MultiDex: True
    Actually, I already have this in.
     
    Last edited: Aug 23, 2018
  19. Erel

    Erel Administrator Staff Member Licensed User

    Does it start working when you click on the app icon again?
     
  20. shb777

    shb777 Active Member Licensed User

    no Like I've said, I've had the multidex statement in all along because my new app is based on drone mission
     
    Last edited: Aug 23, 2018
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice