dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
972 stars 580 forks source link

Close on tap "Register APP" in official sample app #1249

Open EchoPouet opened 9 months ago

EchoPouet commented 9 months ago

Hello,

The official sample app of Mobile-SDK-Android is crashed on tap to button "Register APP" (on calling the DJISDKManager.getInstance().registerApp(...)).

2023-09-27 13:53:42.077 16428-16817 DJISDKManager           com.dji.sdk.sample                   E  Failed to load LDM Plus license file /storage/emulated/0/Android/data/com.dji.sdk.sample/files/DJI/com.dji.sdk.sample.dlf: open failed: ENOENT (No such file or directory)
2023-09-27 13:56:48.529 16428-16817 .dji.sdk.sampl          com.dji.sdk.sample                   W  Suspending all threads took: 11.585ms
2023-09-27 13:56:53.620 16428-16822 .dji.sdk.sampl          com.dji.sdk.sample                   W  Verification of dji.waypointv2.natives.util.NativeCallbackUtils$CommonCallback dji.internal.hgf.fdd.fdd(dji.common.util.CommonCallbacks$CompletionCallback) took 354.792ms (16.91 bytecodes/s) (872B approximate peak alloc)
2023-09-27 13:56:53.841 16428-16822 .dji.sdk.sampl          com.dji.sdk.sample                   W  Verification of dji.waypointv2.natives.util.NativeCallbackUtils$CommonCallbackWithTwoParam dji.internal.hgf.fdd.fdd(dji.common.util.CommonCallbacks$CompletionCallbackWithTwoParam) took 219.593ms (27.32 bytecodes/s) (888B approximate peak alloc)
2023-09-27 13:56:53.969 16428-16822 .dji.sdk.sampl          com.dji.sdk.sample                   W  Verification of void dji.internal.hgf.fdd.fdd(dji.internal.analytics.listener.DJIAnalyticsEventListener, java.lang.String, java.lang.String, dji.internal.network.DJIAnalyticsEvent) took 127.875ms (93.84 bytecodes/s) (1048B approximate peak alloc)
2023-09-27 13:56:54.342 16428-16822 .dji.sdk.sampl          com.dji.sdk.sample                   W  Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
2023-09-27 13:56:54.342 16428-16822 .dji.sdk.sampl          com.dji.sdk.sample                   W  Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
2023-09-27 13:56:54.342 16428-16822 .dji.sdk.sampl          com.dji.sdk.sample                   W  Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
2023-09-27 13:56:56.508  3533-3533  audit                   auditd                               E  type=1400 audit(1695815816.505:5127): avc:  denied  { execmod } for  pid=16428 comm="CommonThreadPoo" path="/data/app/~~5odb4FFlKOwDr_KuXpjzrw==/com.dji.sdk.sample-6eySXku7KiXDzjwp-q3W9Q==/lib/arm/libGroudStation.so" dev="mmcblk0p33" ino=656184 scontext=u:r:untrusted_app:s0:c11,c257,c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0 SEPF_SM-T510_11_0010 audit_filtered
2023-09-27 13:56:56.509 16428-16877 onLoad                  com.dji.sdk.sample                   I  loaded onLoad.cpp :JNI_OnLoad() go to end
2023-09-27 13:56:56.509  3533-3533  audit                   auditd                               E  type=1327 audit(1695815816.505:5127): proctitle="com.dji.sdk.sample"
2023-09-27 13:56:56.511 16428-16877 libc                    com.dji.sdk.sample                   A  Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xb6faa0f4 in tid 16877 (CommonThreadPoo), pid 16428 (.dji.sdk.sample)
2023-09-27 13:56:56.689 16906-16906 DEBUG                   pid-16906                            A  pid: 16428, tid: 16877, name: CommonThreadPoo  >>> com.dji.sdk.sample <<<
2023-09-27 13:56:56.692 16906-16906 DEBUG                   pid-16906                            A        #00 pc 000040f4  /data/app/~~5odb4FFlKOwDr_KuXpjzrw==/com.dji.sdk.sample-6eySXku7KiXDzjwp-q3W9Q==/lib/arm/libGroudStation.so (offset 0x4000)
---------------------------- PROCESS ENDED (16428) for package com.dji.sdk.sample ----------------------------

Android SDK version 31 The DJI MSDK version is 4.16.4

Can you help me ?

dji-dev commented 9 months ago

Agent comment from yating.liao in Zendesk ticket #91990:

The 4.16.4 version of our software is not compatible with Android 13. However, you can try upgrading to the 4.17-a1 version. This version should be compatible with Android 13.

°°°

EchoPouet commented 9 months ago

I tried version 4.16.4 on Samsung Android 11 and I have this issue now:

Failed to load LDM Plus license file /storage/emulated/0/Android/data/com.dji.sdk.sample/files/DJI/com.dji.sdk.sample.dlf: open failed: ENOENT (No such file or directory)
2023-09-29 09:57:50.669  3035-7189  .dji.sdk.sampl          com.dji.sdk.sample                   W  Verification of dji.midware.uio.dgh dji.internal.hgf.fdd.fdd(dji.common.util.CommonCallbacks$CompletionCallback, java.lang.Class) took 7.307s (0.68 bytecodes/s) (808B approximate peak alloc)
2023-09-29 09:57:50.685  3035-6424  .dji.sdk.sampl          com.dji.sdk.sample                   W  Suspending all threads took: 7.094ms
2023-09-29 09:57:52.384  3035-7189  .dji.sdk.sampl          com.dji.sdk.sample                   W  Verification of dji.waypointv2.natives.util.NativeCallbackUtils$CommonCallback dji.internal.hgf.fdd.fdd(dji.common.util.CommonCallbacks$CompletionCallback) took 1.713s (3.50 bytecodes/s) (872B approximate peak alloc)
2023-09-29 09:57:54.906  3035-7189  .dji.sdk.sampl          com.dji.sdk.sample                   W  Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
2023-09-29 09:57:54.909  3035-7189  .dji.sdk.sampl          com.dji.sdk.sample                   W  Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
2023-09-29 09:57:54.909  3035-7189  .dji.sdk.sampl          com.dji.sdk.sample                   W  Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
2023-09-29 09:57:57.301  3035-8473  onLoad                  com.dji.sdk.sample                   I  loaded onLoad.cpp :JNI_OnLoad() go to end
2023-09-29 09:57:57.303  3535-3535  audit                   auditd                               E  type=1400 audit(1695974277.297:875): avc:  denied  { execmod } for  pid=3035 comm="CommonThreadPoo" path="/data/app/~~Y76UWwR0HrJtV1ReseKieQ==/com.dji.sdk.sample-GdckN5ckrlo3dBTWKer55w==/lib/arm/libGroudStation.so" dev="mmcblk0p33" ino=656515 scontext=u:r:untrusted_app:s0:c11,c257,c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0 SEPF_SM-T510_11_0010 audit_filtered
2023-09-29 09:57:57.303  3535-3535  audit                   auditd                               E  type=1327 audit(1695974277.297:875): proctitle="com.dji.sdk.sample"
2023-09-29 09:57:57.305  3035-8473  libc                    com.dji.sdk.sample                   A  Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xaf26a0f4 in tid 8473 (CommonThreadPoo), pid 3035 (.dji.sdk.sample)
2023-09-29 09:57:57.606  8537-8537  DEBUG                   pid-8537                             A  pid: 3035, tid: 8473, name: CommonThreadPoo  >>> com.dji.sdk.sample <<<
2023-09-29 09:57:57.608  8537-8537  DEBUG                   pid-8537                             A        #00 pc 000040f4  /data/app/~~Y76UWwR0HrJtV1ReseKieQ==/com.dji.sdk.sample-GdckN5ckrlo3dBTWKer55w==/lib/arm/libGroudStation.so (offset 0x4000)
2023-09-29 09:57:58.098  3035-7189  System.err              com.dji.sdk.sample                   W  java.lang.NoSuchMethodException: dji.midware.data.model.P3.DataGetProductInfoFromPayload.getInstance []
2023-09-29 09:57:58.106  3035-7189  System.err              com.dji.sdk.sample                   W      at java.lang.Class.getMethod(Class.java:2072)
2023-09-29 09:57:58.108  3035-7189  System.err              com.dji.sdk.sample                   W      at java.lang.Class.getMethod(Class.java:1693)
2023-09-29 09:57:58.110  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.config.P3.nhf.getDataBaseInstRefl(Unknown Source:14)
2023-09-29 09:57:58.112  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.config.P3.CmdIdPayloadSDK$CmdIdType.<init>(Unknown Source:12)
2023-09-29 09:57:58.114  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.config.P3.CmdIdPayloadSDK$CmdIdType.<clinit>(Unknown Source:252)
2023-09-29 09:57:58.116  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.config.P3.CmdIdPayloadSDK$CmdIdType.getValues(Unknown Source:0)
2023-09-29 09:57:58.118  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.config.P3.CmdIdPayloadSDK.fdd(Unknown Source:0)
2023-09-29 09:57:58.119  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.config.P3.fdd.<init>(Unknown Source:10)
2023-09-29 09:57:58.121  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.config.P3.CmdIdPayloadSDK.<init>(Unknown Source:0)
2023-09-29 09:57:58.123  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.config.P3.CmdSet.<clinit>(Unknown Source:762)
2023-09-29 09:57:58.125  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.manager.P3.nhf.<init>(Unknown Source:97)
2023-09-29 09:57:58.127  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.manager.P3.hjn.<init>(Unknown Source:35)
2023-09-29 09:57:58.128  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.manager.P3.DJIVideoPackManager.<init>(Unknown Source:1)
2023-09-29 09:57:58.130  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.manager.P3.DJIVideoPackManager.getInstance(Unknown Source:9)
2023-09-29 09:57:58.132  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.link.fdd.gfd(Unknown Source:36)
2023-09-29 09:57:58.134  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.link.fdd.<init>(Unknown Source:10)
2023-09-29 09:57:58.135  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.link.fdd.getInstance(Unknown Source:9)
2023-09-29 09:57:58.137  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.data.manager.P3.ServiceManager.ddf(Unknown Source:30)
2023-09-29 09:57:58.138  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.midware.dgh.fdd(Unknown Source:27)
2023-09-29 09:57:58.140  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.sdksharedlib.fdd.fdd(Unknown Source:6)
2023-09-29 09:57:58.141  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown Source:15)
2023-09-29 09:57:58.143  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:27)
2023-09-29 09:57:58.145  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.sdk.sdkmanager.DJISDKManager.registerApp(Unknown Source:37)
2023-09-29 09:57:58.146  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.sdk.sdkmanager.DJISDKManager.access$1400(Unknown Source:0)
2023-09-29 09:57:58.148  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.sdk.sdkmanager.DJISDKManager$8.onDownloadSuccess(Unknown Source:6)
2023-09-29 09:57:58.149  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.internal.jhg.fdd.fdd(Unknown Source:19)
2023-09-29 09:57:58.151  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.sdk.sdkmanager.DJISDKManager.lambda$registerApp$2(Unknown Source:27)
2023-09-29 09:57:58.153  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.sdk.sdkmanager.DJISDKManager$$Lambda$4.run(Unknown Source:2)
2023-09-29 09:57:58.154  3035-7189  System.err              com.dji.sdk.sample                   W      at dji.sdksharedlib.dgh.dgh$fdd.run(Unknown Source:5)
2023-09-29 09:57:58.156  3035-7189  System.err              com.dji.sdk.sample                   W      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
2023-09-29 09:57:58.158  3035-7189  System.err              com.dji.sdk.sample                   W      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2023-09-29 09:57:58.159  3035-7189  System.err              com.dji.sdk.sample                   W      at java.lang.Thread.run(Thread.java:923)
2023-09-29 09:57:58.267  3035-5603  .dji.sdk.sampl          com.dji.sdk.sample                   I  Background young concurrent copying GC freed 16987(1547KB) AllocSpace objects, 11(404KB) LOS objects, 26% free, 5404KB/7312KB, paused 4.210ms total 209.141ms
2023-09-29 09:57:58.328  3035-8504  .dji.sdk.sampl          com.dji.sdk.sample                   W  Long monitor contention with owner UrgentThreadPool#1 (7189) at dji.midware.data.manager.P3.DJIVideoPackManager dji.midware.data.manager.P3.DJIVideoPackManager.getInstance()(:-1) waiters=0 in dji.midware.data.manager.P3.DJIVideoPackManager dji.midware.data.manager.P3.DJIVideoPackManager.getInstance() for 2.368s
2023-09-29 09:57:58.445  3035-5603  .dji.sdk.sampl          com.dji.sdk.sample                   I  Background concurrent copying GC freed 1865(481KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 6779KB/13MB, paused 388us total 104.477ms
2023-09-29 09:57:58.628  3035-7189  DJIUsbAccessoryReceiver com.dji.sdk.sample                   E  start accessory receiver
2023-09-29 09:57:58.666  3035-7189  .dji.sdk.sampl          com.dji.sdk.sample                   W  Accessing hidden method Landroid/app/ActivityThread;->currentApplication()Landroid/app/Application; (greylist, reflection, allowed)
2023-09-29 09:57:58.741  3035-6159  DJIUsbAccessoryReceiver com.dji.sdk.sample                   E  receive action: android.hardware.usb.action.USB_STATE
2023-09-29 09:57:58.764  3035-6159  DJIUsbAccessoryReceiver com.dji.sdk.sample                   E  android.hardware.usb.action.USB_STATE: is connected
2023-09-29 09:57:59.046  3035-5603  .dji.sdk.sampl          com.dji.sdk.sample                   I  Background young concurrent copying GC freed 1830(248KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 18MB/18MB, paused 558us total 200.624ms
2023-09-29 09:57:59.181  3035-8563  logWrite.cpp            com.dji.sdk.sample                   D  UDT JNI_OnLoad---------------->
2023-09-29 09:57:59.182  3035-8563  logWrite.cpp            com.dji.sdk.sample                   D  UDP jniRegisterNativeMethods: jniRegisterNativeMethods
2023-09-29 09:57:59.182  3035-8563  logWrite.cpp            com.dji.sdk.sample                   D  loaded UDT :JNI_OnLoad() go to end
2023-09-29 09:57:59.185  3035-8577  TetheringManager        com.dji.sdk.sample                   I  registerTetheringEventCallback:com.dji.sdk.sample
2023-09-29 09:57:59.201  3035-8577  ConnectivityManager     com.dji.sdk.sample                   D  ConnectivityManager() mContext=com.dji.sdk.sample.internal.controller.DJISampleApplication@83bb15b getOpPackageName()=com.dji.sdk.sample getBasePackageName()=com.dji.sdk.sample getPackageName()=com.dji.sdk.sample
2023-09-29 09:57:59.203  3035-5603  .dji.sdk.sampl          com.dji.sdk.sample                   I  Background concurrent copying GC freed 473(111KB) AllocSpace objects, 2(428KB) LOS objects, 49% free, 18MB/36MB, paused 641us total 145.797ms
2023-09-29 09:57:59.357  3035-7189  BluetoothAdapter        com.dji.sdk.sample                   I  STATE_BLE_ON
2023-09-29 09:57:59.360  3035-7189  BluetoothAdapter        com.dji.sdk.sample                   I  appoCount is = 0 G/S = 3/3
2023-09-29 09:57:59.360  3035-7189  BluetoothAdapter        com.dji.sdk.sample                   W  getBluetoothLeScanner() ble not available
2023-09-29 09:57:59.487  3035-8600  Lightbridge             com.dji.sdk.sample                   E  Failed to obtain JNIEnv
2023-09-29 09:57:59.493  3035-8603  Lightbridge             com.dji.sdk.sample                   E  Failed to obtain JNIEnv
2023-09-29 09:57:59.493  3035-8604  Lightbridge             com.dji.sdk.sample                   E  Failed to obtain JNIEnv
2023-09-29 09:57:59.495  3035-8605  Lightbridge             com.dji.sdk.sample                   E  Failed to obtain JNIEnv
2023-09-29 09:57:59.496  3035-8601  Lightbridge             com.dji.sdk.sample                   E  Failed to obtain JNIEnv
2023-09-29 09:57:59.496  3035-8602  Lightbridge             com.dji.sdk.sample                   E  Failed to obtain JNIEnv
2023-09-29 09:57:59.947  3035-7189  DJIComponentManager     com.dji.sdk.sample                   E  Service Not Connected
2023-09-29 09:57:59.949  3035-7189  DJIComponentManager     com.dji.sdk.sample                   E  Service Not Connected
2023-09-29 09:57:59.950  3035-7189  DJIComponentManager     com.dji.sdk.sample                   E  Service Not Connected
2023-09-29 09:58:00.917  3035-6159  DJIComponentManager     com.dji.sdk.sample                   E  Service Not Connected
2023-09-29 09:58:00.919  3035-6159  DJIComponentManager     com.dji.sdk.sample                   E  Service Not Connected
2023-09-29 09:58:00.921  3035-6159  DJIComponentManager     com.dji.sdk.sample                   E  Service Not Connected
2023-09-29 09:58:00.964  3035-6159  DJIUsbAccessoryReceiver com.dji.sdk.sample                   E  check accessory handler
2023-09-29 09:58:02.000  3920-4062  InputDispatcher         system_server                        E  channel 'c80b006 com.dji.sdk.sample/com.dji.sdk.sample.internal.controller.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

I can't upgrade my device to a newer Android version.

dji-dev commented 9 months ago

Agent comment from yating.liao in Zendesk ticket #91990:

Could you give us the code you used?

°°°

EchoPouet commented 9 months ago

I use this sample and the problem is when DJISDKManager.getInstance().registerApp is called at line 571 in MainContent.java.

Extract:

                        DJISDKManager.getInstance().registerApp(mContext.getApplicationContext(), new DJISDKManager.SDKManagerCallback() {
                            @Override
                            public void onRegister(DJIError djiError) {
                                if (djiError == DJISDKError.REGISTRATION_SUCCESS) {
                                    DJILog.e("App registration", DJISDKError.REGISTRATION_SUCCESS.getDescription());
                                    DJISDKManager.getInstance().startConnectionToProduct();
                                    ToastUtils.setResultToToast(mContext.getString(R.string.sdk_registration_success_message));
                                } else {
                                    ToastUtils.setResultToToast(mContext.getString(R.string.sdk_registration_message) + djiError.getDescription());
                                }
                                Log.v(TAG, djiError.getDescription());
                                hideProcess();
                            }
dji-dev commented 8 months ago

Agent comment from yating.liao in Zendesk ticket #91990:

This issue has been fixed in version 4.17-a1. You can upgrade to this version and give it a try.

°°°

EchoPouet commented 8 months ago

I have only Android 11 so I can't use version 4.17-a1 :(

dji-dev commented 8 months ago

Agent comment from yating.liao in Zendesk ticket #91990:

The version 4.17-a1 can be run on devices with Android 11. The minimum supported API version for this version is 23, which corresponds to Android 6.

°°°