MSDK V5.6 官方demo 进入到飞行控制页 崩溃。

Completed

Comments

13 comments

  • Boerma

    有个view的自定义属性找不到。你编译的时候不报错?还是你把报错忽略了?

    0
    Comment actions Permalink
  • Boerma

    也有可能是gradle设置导致的问题,你这是官方demo?不是吧,包名都不一样

    0
    Comment actions Permalink
  • simonkjer

    把自己申请的开发者的key,放到项目中配置。

    单独的把packagename 改成自己申请的对应name ,然后运行的。没有改其他代码。

    1
    Comment actions Permalink
  • Boerma

    感觉是编译问题

    2023-11-01 16:49:17.258  3834-3948  DJIV5/RXUtil            com.test.djisdk.app                  E  (co_a:27) io.reactivex.rxjava3.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference 

     

    dji.v5.ux.core.panel.systemstatus.SystemStatusSmartListModel.createWidget(SystemStatusSmartListModel.kt:114)
                                                  

    结合这两个日志看一下吧。

    建议别改包名,申请key试一下。

    0
    Comment actions Permalink
  • simonkjer

    首先感谢耐心的解答。  我把项目的主要配置和gradle 贴到下边,麻烦帮忙查看下。之前这套配置没有问题,demo能够正常运行在遥控器中的,但是最近出现必现崩溃。

    gradle.properties 中: 

    distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip

     

    project  as 模块的 build.gradle: 中是

    classpath 'com.android.tools.build:gradle:7.1.2'

    module  app-aircraft build.gradle 如下:

    android {
    compileSdkVersion Integer.parseInt(project.ANDROID_COMPILE_SDK_VERSION)//33

    defaultConfig {
    // applicationId "com.dji.sampleV5.aircraft"
    applicationId "com.test.djisdk.app"
    minSdkVersion Integer.parseInt(project.ANDROID_MIN_SDK_VERSION)//23
    targetSdkVersion Integer.parseInt(project.ANDROID_TARGET_SDK_VERSION)//33
    versionCode 1
    versionName "1.0"
    manifestPlaceholders["API_KEY"] = project.AIRCRAFT_API_KEY

    ndk {
    abiFilters 'arm64-v8a'
    }
    }

     

     AS版本如下: 

    Android Studio Giraffe | 2022.3.1 Patch 2
    Build #AI-223.8836.35.2231.10811636, built on September 15, 2023
    Runtime version: 17.0.6+0-b2043.56-10027231 amd64
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
    Windows 11 10.0
    GC: G1 Young Generation, G1 Old Generation
    Memory: 1280M
    Cores: 20
    Registry:
        external.system.auto.import.disabled=true
        ide.text.editor.with.preview.show.floating.toolbar=false
        ide.instant.shutdown=false
        ide.balloon.shadow.size=0

      java版本是:  11.0.20 2023-07-18 LTS
        

    然后我再次build 项目,编译是没有报错的,只是运行后崩溃。  麻烦大佬帮忙定位解惑。

     

     

    0
    Comment actions Permalink
  • simonkjer

    1、首先再次感谢耐心解答.

    2、然后我本地试了一下: 如果不改 applicationId,  demo运行是无法点击 "默认演示页面"的按钮的。因此无法进入飞控页面。
    3、我将 applicationId 改为我之前申请的id后,重新编译运行,然后能够正常看到toast提示连接成功的提醒。可以点击进入飞控页面。
    4、看到之前所说的问题定位方向,我尝试注释掉此( ListPanelWidget.kt:128 行)代码,是可以正常进入并操作的。不会出现崩溃问题。但是代码逻辑不完整。同时也对比了 注释后运行的log,发现rxjava3的提醒同样会输出。

    截取如下:
    (co_a:27) io.reactivex.rxjava3.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | io.reactivex.rxjava3.exceptions.MissingBackpressureException: Can't deliver value due to lack of requests

    那说明这个问题不是崩溃所在。

    那么现在就剩您上边所说 自定义属性这块有问题,我该如何修改比规避呢? 

    1
    Comment actions Permalink
  • Boerma

    找到崩溃点,断点进行跟踪,判断是那个参数名获取不到。然后全局搜索,看看位置在哪,以及了解这个参数如何编译及使用

    0
    Comment actions Permalink
  • DJI Developer Support
    从日志来看是资源文件导致的崩溃。你有升级过Android studio版本或者JDK版本吗?也有可能是R文件冲突导致的崩溃,UXSDK有维护自己的R文件。
    0
    Comment actions Permalink
  • simonkjer

      谢谢大疆工作人员的耐心回答。 我AS  没有更新,还是上边贴出的版本。之前jdk 是21 ,也是怀疑版本太高兼容问题,卸载后,重新装了11。也和同事对比本地的gradle 配置和版本,没有差异。

      那我再定位下是否是r文件冲突导致的问题。因为同样的环境之前也随机出现过一次,然后第二天就又可以重新跑起来了,遥控器和飞机没有更新固件。

    0
    Comment actions Permalink
  • DJI Developer Support
    JDK 11应该是没有问题,我们还没有验证过更改高版本的JDK在SDK上的表现,你使用JDK 11和8应该都是没问题的。
    0
    Comment actions Permalink
  • simonkjer

    问题已解决。不是代码和环境配置问题。是遥控器系统设置的问题。

    0
    Comment actions Permalink
  • Himanshu6124

    I am facing the same problem, I am using DJI SDK version 5.5 and aircraft model mini3

    0
    Comment actions Permalink
  • simonkjer

    This is related to the developer mode in the remote control, you can try to turn off the attempt attribute switch, hoping to help you。

    0
    Comment actions Permalink

Please sign in to leave a comment.