dji-sdk / Mobile-SDK-Android

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

java.lang.VerifyError: Verifier rejected class dji.sdk.sdkmanager #1172

Open Needrom opened 1 year ago

Needrom commented 1 year ago

problem

I could run sample code 4.14trail1 on my device. But when I follow the DJI moblie SDK tutorial on the DJI dev webside to build my own app. I Got the problem.

LogCat

2022-08-29 14:38:13.885 5728-5757/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
    Process: com.example.androiddjiemptytest, PID: 5728
    java.lang.VerifyError: Verifier rejected class dji.sdk.sdkmanager.DJISDKManager: void dji.sdk.sdkmanager.DJISDKManager.<init>() failed to verify: void dji.sdk.sdkmanager.DJISDKManager.<init>(): [0x0] Constructor returning without calling superclass constructor (declaration of 'dji.sdk.sdkmanager.DJISDKManager' appears in /data/data/com.example.androiddjiemptytest/code_cache/.overlay/base.apk/classes.dex)
        at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)
        at com.example.androiddjiemptytest.MainActivity$1.run(MainActivity.java:137)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)

Code with problem

DJISDKManager.getInstance().registerApp(MainActivity.this.getApplicationContext(), new DJISDKManager.SDKManagerCallback()

Device

OPPO K3 on Android 11

I had seen all the issue about this problem.Not any means is the solution about this question. All I just know a bunch of empty function in class SDKManager but I could do nothing but ask you for help how to fix '''Constructor returning without calling superclass constructor'''

DJI-William commented 1 year ago

The tutorial is out of date, please don't follow the guide. I suggest you just try this Sample with the latest Android 4.16.2 now.

Needrom commented 1 year ago

The tutorial is out of date, please don't follow the guide. I suggest you just try this Sample with the latest Android 4.16.2 now.

But how could I just merge it into the other project not build on it.

DJI-William commented 1 year ago

The tutorial is out of date, please don't follow the guide. I suggest you just try this Sample with the latest Android 4.16.2 now.

But how could I just merge it into the other project not build on it.

I am sorry for the out of date of tutorials. I know this is very hard, you have to compare the tutorials and the Sample to find out a difference and write your own project. Which aircraft are you using? If you are using M300RTK or M30 series, we suggest you switch to MSDK V5.