0

我对我在 Eclipse 上开发一段时间的 Android Studio SDK 感到沮丧,但有时会努力迁移到 Android Studio。我无法开始使用 Android Studio。

我正在尝试在 Android Studio 上实现一个名为“ PlaybackDemo ”的DJI演示。我已经让它在 Eclipse 上运行,但 Android Studio 版本不起作用。应用程序按预期启动 DJIAoaActivity 和 DroneSelectionActivity,但是当您选择无人机类型时,PlaybackProtocolActivity 不会启动并且应用程序崩溃。我没有从 PlaybackProtocolActivity 获得 LogCat 上的 OnGetPermissionResult。

我总是收到以下错误:

11-11 11:52:56.338 28334-28334/com.example.myapp E/CliptrayUtils: hideClipTrayIfNeeded() TextView is focused!! hideClipTray()
11-11 11:52:58.058 28334-28334/com.example.myapp E/FPVController: Couldn't load lib
11-11 11:52:58.058 28334-28334/com.example.myapp E/art: No implementation found for int dji.midware.natives.FPVController.native_setIsNeedPacked(boolean) (tried Java_dji_midware_natives_FPVController_native_1setIsNeedPacked and Java_dji_midware_natives_FPVController_native_1setIsNeedPacked__Z)
11-11 11:52:58.186 28334-30034/com.example.myapp E/art: No implementation found for long dji.midware.natives.GroudStation.native_hashFromString(byte[]) (tried Java_dji_midware_natives_GroudStation_native_1hashFromString and Java_dji_midware_natives_GroudStation_native_1hashFromString___3B)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime: FATAL EXCEPTION: main
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime: Process: com.example.myapp, PID: 28334
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for int dji.midware.natives.FPVController.native_setIsNeedPacked(boolean) (tried Java_dji_midware_natives_FPVController_native_1setIsNeedPacked and Java_dji_midware_natives_FPVController_native_1setIsNeedPacked__Z)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at dji.midware.natives.FPVController.native_setIsNeedPacked(Native Method)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at dji.sdk.api.DJIDrone.connectToInspire(Unknown Source)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at dji.sdk.api.DJIDrone.connectToDrone(Unknown Source)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at com.example.myapp.PlaybackProtocolActivity.onInitSDK(PlaybackProtocolActivity.java:473)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at com.example.myapp.PlaybackProtocolActivity.onCreate(PlaybackProtocolActivity.java:154)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6020)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2259)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2366)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at android.app.ActivityThread.access$800(ActivityThread.java:149)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:135)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5290)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
11-11 11:52:58.230 28334-28334/com.example.myapp E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
4

2 回答 2

0

对我来说,我是一个 Android Studio 人,我遇到了一个更严重的问题。当我尝试在 Android Studio 中打开 PlaybackDemo 并选择项目导航器上的“Android”选项卡时,没有任何显示。似乎项目结构不正确,不适合 Android Studio。

而且我刚才查了一下PlaybackDemo,据说是用DJI SDK 2.4开发的?这比当前版本 3.1.1 旧了很多。似乎有马车。

顺便说一句,如果你真的想在 Android Studio 上尝试 DJI Android SDK,我建议你查看这个 Import DJI SDK to Android Studio教程,它对我有用。</p>

于 2016-04-14T13:27:45.100 回答
0

从日志中很明显。感兴趣的线:

java.lang.UnsatisfiedLinkError: No implementation found for int dji.midware.natives.FPVController.native_setIsNeedPacked(boolean) (试过 Java_dji_midware_natives_FPVController_native_1setIsNeedPacked 和 Java_dji_midware_natives_FPVController_native_1setIsNeedPacked__Z)

我的猜测:您已经链接了 x86 本机库,但没有为您的手机使用的处理器链接本机库。本机库的诅咒:您需要为要运行的每个处理器预编译它们。

我不熟悉 Eclipse 上的 NDK 开发。如果您使用的是 Android Studio,则每个处理器系列都会有单独的构建目标,另外还有一个用于构建和包含您选择支持的所有处理器的本机库到一个 APK 中。Eclipse 大概有一些等效的概念来在某个地方构建目标。

于 2015-11-12T06:43:02.540 回答