我正在使用DJI Android SDK版本4.10,并根据要求使用了here定义的Proguard文件。
向SDK注册时,发布版本崩溃,并出现以下问题:
AndroidRuntime: java.lang.ExceptionInInitializerError
AndroidRuntime: at dji.sdk.realname.aircraftbinding.a$a.a(Unknown Source:0)
AndroidRuntime: at dji.sdk.realname.aircraftbinding.a.getInstance(Unknown Source:0)
AndroidRuntime: at dji.sdk.realname.aircraftbinding.g.a(Unknown Source:26)
AndroidRuntime: at dji.sdk.realname.AppActivationManager.init(Unknown Source:25)
AndroidRuntime: at dji.sdk.sdkmanager.DJISDKManager.initParams(Unknown Source:115)
AndroidRuntime: at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source:141)
AndroidRuntime: at dji.sdk.sdkmanager.DJISDKManager.access$1300(Unknown Source:0)
AndroidRuntime: at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source:121)
AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
AndroidRuntime: Caused by: java.lang.RuntimeException: Missing type parameter.
AndroidRuntime: at com.google.gson.reflect.TypeToken.getSuperclassTypeParameter(Unknown Source:26)
AndroidRuntime: at com.google.gson.reflect.TypeToken.<init>(Unknown Source:5)
AndroidRuntime: at dji.sdk.realname.aircraftbinding.a$1.<init>(Unknown Source:2)
AndroidRuntime: at dji.sdk.realname.aircraftbinding.a.d(Unknown Source:34)
AndroidRuntime: at dji.sdk.realname.aircraftbinding.a.<init>(Unknown Source:21)
AndroidRuntime: at dji.sdk.realname.aircraftbinding.a.<init>(Unknown Source:0)
AndroidRuntime: at dji.sdk.realname.aircraftbinding.a$a.<clinit>(Unknown Source:3)
AndroidRuntime: ... 9 more
我正在使用以下build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
...
android {
compileSdkVersion 28
defaultConfig {
...
minSdkVersion 21
targetSdkVersion 28
versionName "0.3.0"
...
}
...
ndk {
// On x86 devices that run Android API 23 or above, if the application is targeted with API 23 or
// above, FFmpeg lib might lead to runtime crashes or warnings.
abiFilters 'armeabi-v7a', 'x86', 'arm64-v8a'
}
}
// DJI Requirements
packagingOptions {
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"
exclude 'META-INF/rxjava.properties'
}
...
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
...
}
...
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
...
/* Kotlin */
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
/* Android */
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-compat:28.0.0'
implementation 'com.android.support:preference-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
/* Constraint Layout */
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
/* Recycler View */
implementation 'com.android.support:recyclerview-v7:28.0.0'
/* Android Lifecycle */
implementation 'android.arch.lifecycle:extensions:1.1.1'
kapt 'android.arch.lifecycle:compiler:1.1.1'
/* Room components */
implementation "android.arch.persistence.room:runtime:1.1.1"
kapt "android.arch.persistence.room:compiler:1.1.1"
/* License list */
implementation 'com.google.android.gms:play-services-oss-licenses:16.0.2'
/* Dependency Injection */
implementation 'org.koin:koin-android-viewmodel:1.0.2'
implementation 'org.koin:koin-android:1.0.2'
/* DJI stuff */
implementation 'com.dji:dji-sdk:4.10'
compileOnly 'com.dji:dji-sdk-provided:4.10'
/* Geographic Lib for distance calculation */
implementation 'net.sf.geographiclib:GeographicLib-Java:1.49'
/* Test */
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.27.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'android.arch.persistence.room:testing:1.1.1'
}
在线查看似乎表明Proguard,Gson和Jack可能存在此问题。不过,我还没有看到任何关于此问题的答案。
答案 0 :(得分:0)
可能会有所帮助。使用新版SDK 4.10崩溃的讨论。 https://docker.pkg.github.com/DJI-Mobile-SDK-Tutorials/Android-VideoStreamDecodingSample/issues/54