RaulJ
RaulJ

Reputation: 33

Unable to import SDK DJI android

I'm trying to integrate SDK into Application with Android studio. I just follow the steps but i don't know if its because of versions or i don't know...

I use:

I'm unable to run the app and I receive this errors when i run the app:

 2020-02-14 18:23:14.708 13105-13144/com.dji.importSDKDemo E/linker:
> "/data/app/com.dji.importSDKDemo-yT7PkOy_GdSaDNcQYUqr9w==/lib/x86/libffmpeg.so"
> has text relocations
> (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
>     2020-02-14 18:23:14.712 13105-13144/com.dji.importSDKDemo W/System.err: java.lang.UnsatisfiedLinkError: dlopen failed:
> "/data/app/com.dji.importSDKDemo-yT7PkOy_GdSaDNcQYUqr9w==/lib/x86/libffmpeg.so"
> has text relocations
> (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
>     2020-02-14 18:23:14.712 13105-13144/com.dji.importSDKDemo W/System.err:     at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
>     2020-02-14 18:23:14.713 13105-13144/com.dji.importSDKDemo W/System.err:     at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
>     2020-02-14 18:23:14.713 13105-13144/com.dji.importSDKDemo W/System.err:     at java.lang.System.loadLibrary(System.java:1667)
>     2020-02-14 18:23:14.713 13105-13144/com.dji.importSDKDemo W/System.err:     at
> dji.midware.natives.SDKRelativeJNI.<clinit>(Unknown Source:2)
>     2020-02-14 18:23:14.713 13105-13144/com.dji.importSDKDemo W/System.err:     at
> dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString(Native
> Method)
>     2020-02-14 18:23:14.713 13105-13144/com.dji.importSDKDemo W/System.err:     at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown
> Source:32)
>     2020-02-14 18:23:14.714 13105-13144/com.dji.importSDKDemo W/System.err:     at
> dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)
>     2020-02-14 18:23:14.714 13105-13144/com.dji.importSDKDemo W/System.err:     at
> com.dji.importSDKDemo.MainActivity$1.run(MainActivity.java:125)
>     2020-02-14 18:23:14.714 13105-13144/com.dji.importSDKDemo W/System.err:     at
> android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
>     2020-02-14 18:23:14.714 13105-13144/com.dji.importSDKDemo W/System.err:     at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
>     2020-02-14 18:23:14.715 13105-13144/com.dji.importSDKDemo W/System.err:     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
>     2020-02-14 18:23:14.715 13105-13144/com.dji.importSDKDemo W/System.err:     at java.lang.Thread.run(Thread.java:919)
>     2020-02-14 18:23:14.715 13105-13144/com.dji.importSDKDemo D/SDKRelativeJNI: Couldn't load lib
>     2020-02-14 18:23:14.716 13105-13144/com.dji.importSDKDemo E/i.importSDKDem: No implementation found for java.lang.String
> dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString()
> (tried
> Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString
> and
> Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString__)
>     2020-02-14 18:23:14.719 13105-13144/com.dji.importSDKDemo E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
>         Process: com.dji.importSDKDemo, PID: 13105
>         java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String
> dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString()
> (tried
> Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString
> and
> Java_dji_midware_natives_SDKRelativeJNI_native_1getUsbAccessoryAttachedString__)
>             at dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString(Native
> Method)
>             at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source:32)
>             at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)
>             at com.dji.importSDKDemo.MainActivity$1.run(MainActivity.java:125)
>             at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
>             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:919)
>     2020-02-14 18:23:14.736 13105-13144/com.dji.importSDKDemo I/Process: Sending signal. PID: 13105 SIG: 9

I know it's a very long error, but i don't know what can it be...

Feel free to ask for the code or the screenshots

enter image description here

Upvotes: 0

Views: 398

Answers (1)

Sara Race
Sara Race

Reputation: 363

The line below shows the reason for the error. Because the app is running on an emulator, it can't find a USB accessory. Please try running on a physical device instead.

2020-02-14 18:23:14.713 13105-13144/com.dji.importSDKDemo W/System.err: at dji.midware.natives.SDKRelativeJNI.native_getUsbAccessoryAttachedString(Native Method)

Upvotes: 1

Related Questions