dji-sdk / Mobile-SDK-Android

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

Please someone help me understand #1319

Open minhjlee opened 2 months ago

minhjlee commented 2 months ago

Hi, This is my first time using the android studio and I am struggling to understand how to use this MSDK V4. I downloaded android studio and opened the project "sample code" but the gradle keeps failling. I tried to create a new project but then the mainactivity is in kotlin not in java.

Can someone please help me with how to get this sample code to work?

Thanks!

dji-lyt commented 2 months ago

You need to select this folder during the import process. What information does Gradle provide? image

minhjlee commented 2 months ago

Hi, So somehow I managed it to work and here are the things I had to do to make it work.

  1. Change the Gradle to 7.5.1
  2. Change the Gradle Plugin to 7.4.2
  3. Change the d8.bat and d8.jar to dx.bat and dx.jar
  4. Add org.gradle.jvmargs=-Xmx1920M \ --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \ --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
  5. Change the target Sdkversion to 33

After these, I was able to make it work except some functionalities aren't working. Like the load option, virtual remote option, and more.

Is this reasonble steps to make?

Thanks!

dji-dev commented 2 months ago

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

The changes you made will not affect the use of MSDK. Are you referring to the features of Android Studio?

Perhaps you could check the Android developer forums to see if there are any solutions available.

°°°

minhjlee commented 2 months ago

I see, I also saw your email regarding my issue. I will check the JDK and also see if the load option is showing the error.

dji-dev commented 2 months ago

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

I hope our response is helpful to you. The MSDK sample code can only be used after completing the registration process. You may also want to check out this article:https://developer.dji.com/cn/document/2e5ae092-b0fa-4cbd-abe2-956f44253c12

°°°