DJI android sdk在启动时崩溃(仅在使用macOS构建的情况下)

时间:2019-06-14 05:22:07

标签: android dji-sdk

如果运行的应用程序是基于macOS构建的,则出现异常:

java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.gg.wp-D5RSHkictI89woc7FOnlUQ==/lib/arm64/libSDKRelativeJNI.so" .dynamic section has invalid offset: 0x1c350, expected to match PT_DYNAMIC offset: 0x0
    at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
    at java.lang.System.loadLibrary(System.java:1669)
    at dji.midware.natives.SDKRelativeJNI.<clinit>(Unknown Source:2)
    at dji.midware.natives.SDKRelativeJNI.native_getXXXX(Native Method)
    at com.dji.g.a.a.b.a(Unknown Source:24)
    at com.dji.g.a.a.b.a(Unknown Source:5)
    at dji.sdk.sdkmanager.DJISDKManager.<clinit>(Unknown Source:2)
    at dji.sdk.sdkmanager.DJISDKManager.getInstance(Unknown Source:0)

在此异常之前,我得到了这个:

    @Configuration
    public static class NotifierConfig {
        private final InstanceRepository repository;
        private final ObjectProvider<List<Notifier>> otherNotifiers;

        public NotifierConfig(InstanceRepository repository, ObjectProvider<List<Notifier>> otherNotifiers) {
            this.repository = repository;
            this.otherNotifiers = otherNotifiers;
        }

        @Bean
        public FilteringNotifier filteringNotifier() { 
            CompositeNotifier delegate = new CompositeNotifier(otherNotifiers.getIfAvailable(Collections::emptyList));
            return new FilteringNotifier(delegate, repository);
        }

        @Primary
        @Bean(initMethod = "start", destroyMethod = "stop")
        public RemindingNotifier remindingNotifier() { 
            RemindingNotifier notifier = new RemindingNotifier(filteringNotifier(), repository);
            notifier.setReminderPeriod(Duration.ofMinutes(10));
            notifier.setCheckReminderInverval(Duration.ofSeconds(10));
            return notifier;
        }
    }

但是,如果我在Windows上构建了相同的项目,则它可以正常工作。 我在真实设备(三星Galaxy S10)上运行应用程序,因此它不是x86 ffmpeg问题。

我该如何解决?

1 个答案:

答案 0 :(得分:0)

将这些行添加到gradle.build修复问题:

packagingOptions {
    exclude 'META-INF/rxjava.properties'
    doNotStrip "*/*/libdjivideo.so"
    doNotStrip "*/*/libSDKRelativeJNI.so"
    doNotStrip "*/*/libFlyForbid.so"
    doNotStrip "*/*/libduml_vision_bokeh.so"
    doNotStrip "*/*/libyuv2.so"
    doNotStrip "*/*/libGroudStation.so"
    doNotStrip "*/*/libFRCorkscrew.so"
    doNotStrip "*/*/libUpgradeVerify.so"
    doNotStrip "*/*/libFR.so"

    doNotStrip "*/*/libDJIFlySafeCore.so"
    doNotStrip "*/*/libdjifs_jni.so"
    doNotStrip "*/*/libsfjni.so"
}