SDK 4.15+UX 4.14 报错java.lang.UnsatisfiedLinkError: dlopen ...
CompletedSDK 4.15+UX 4.14 报错java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/~~43r5wBXsHVkEu6RqIS95ng==/com.amastigote.demo.dji-6wsvxFYk7tCuneQ1vrQFgQ==/lib/arm64/libDJISDKLOGJNI.so" .dynamic section has invalid offset: 0x41120, expected to match PT_DYNAMIC offset: 0x0
-
开发平台是IOS还是 Android 呢?是否设置了文件压缩。如果在 windows 平台可以使用的话,感觉像是路径匹配出了问题。 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" doNotStrip "*/*/libDJIFlySafeCore.so" doNotStrip "*/*/libdjifs_jni.so" doNotStrip "*/*/libsfjni.so" doNotStrip "*/*/libDJICommonJNI.so" doNotStrip "*/*/libDJICSDKCommon.so" doNotStrip "*/*/libDJIUpgradeCore.so" doNotStrip "*/*/libDJIUpgradeJNI.so" doNotStrip "*/*/libDJIWaypointV2Core.so" doNotStrip "*/*/libAMapSDK_MAP_v6_9_2.so" doNotStrip "*/*/libDJIMOP.so" doNotStrip "*/*/libDJISDKLOGJNI.so" exclude 'META-INF/rxjava.properties' exclude 'assets/location_map_gps_locked.png' exclude 'assets/location_map_gps_3d.png' } -
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"
doNotStrip "*/*/libDJIFlySafeCore.so"
doNotStrip "*/*/libdjifs_jni.so"
doNotStrip "*/*/libsfjni.so"
doNotStrip "*/*/libDJICommonJNI.so"
doNotStrip "*/*/libDJICSDKCommon.so"
doNotStrip "*/*/libDJIUpgradeCore.so"
doNotStrip "*/*/libDJIUpgradeJNI.so"
doNotStrip "*/*/libDJIWaypointV2Core.so"
doNotStrip "*/*/libAMapSDK_MAP_v6_9_2.so"
doNotStrip "*/*/libDJIMOP.so"
doNotStrip "*/*/libDJISDKLOGJNI.so"
pickFirst 'lib/*/libstlport_shared.so'
pickFirst 'lib/*/libRoadLineRebuildAPI.so'
pickFirst 'lib/*/libGNaviUtils.so'
pickFirst 'lib/*/libGNaviMapex.so'
pickFirst 'lib/*/libGNaviData.so'
pickFirst 'lib/*/libGNaviMap.so'
pickFirst 'lib/*/libGNaviSearch.so'
pickFirst 'lib/*/libDJIFlySafeCore.so'
pickFirst 'lib/*/libdjifs_jni.so'
pickFirst 'lib/*/libsfjni.so'
exclude 'META-INF/proguard/okhttp3.pro'
exclude 'META-INF/rxjava.properties'
exclude 'assets/location_map_gps_locked.png'
exclude 'assets/location_map_gps_3d.png'
}
这是我的配置,运行还是有问题 -
![](https://djisdksupport.zendesk.com/attachments/token/95aKPRlmtNN1CBYpUhOfhkj6h/?name=inline-1858902485.png) 这个配置加固的代码有实现吗?如果还有问题,建议发一下整个配置文件。 -
有实现
//import com.app.plugin.AspectjPlugin
//import com.app.plugin.JavassistPlugin
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.amastigote.demo.dji"
minSdkVersion 19
targetSdkVersion 28
versionCode 30
versionName "3.0"
multiDexEnabled true
renderscriptTargetApi 20
renderscriptSupportModeEnabled true
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
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', 'arm64-v8a'
// abiFilters 'armeabi-v7a'
}
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
dexOptions {
preDexLibraries = false
}
sourceSets {
main {
jniLibs.srcDir 'libs'
}
}
//添加如下代码
compileOptions {
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = '1.8'
}
signingConfigs {
release {
storeFile file('/keystore.jks')
storePassword '1234561'
keyAlias 'curiser_key'
keyPassword '1234561'
}
debug {
storeFile file('/keystore.jks')
storePassword '1234561'
keyAlias = 'curiser_key'
keyPassword '1234561'
}
}
buildTypes {
debug {
buildConfigField "String", "LOGIN_URI", "\"http://uav.ningyingai.com/api/user/login\""
buildConfigField "String", "REGISTER_URI", "\"http://uav.ningyingai.com/api/user/create\""
buildConfigField "String", "UPLOAD_FILE_URI", "\"http://uav.ningyingai.com/api/user/uploadFile\""
buildConfigField "String", "ADDINFO_URI", "\"http://uav.ningyingai.com/api/user/bindProduct\""
buildConfigField "String", "MODIFYINFO_URI", "\"http://uav.ningyingai.com/api/user/updateProduct\""
buildConfigField "String", "DELETEINFO_URI", "\"http://uav.ningyingai.com/api/user/deleteProduct\""
buildConfigField "String", "ONBROAD_URI", "\"http://uav.ningyingai.com/api/user/onbroadmsg\""
buildConfigField "String", "FLYRECORD_URI", "\"http://uav.ningyingai.com/api/user/flyRecord\""
buildConfigField "String", "FLYSTART_URI", "\"http://uav.ningyingai.com/api/uav/start\""
buildConfigField "String", "FLYEND_URI", "\"http://uav.ningyingai.com/api/uav/stop\""
buildConfigField "String", "PRODUCT_URI", "\"http://uav.ningyingai.com/api/user/product\""
buildConfigField "String", "TRAVEL_POST_URI", "\"http://uav.ningyingai.com/api/airway/record\""
buildConfigField "String", "TRAVEL_GET_URI", "\"http://uav.ningyingai.com/api/airway/get\""
buildConfigField "String", "TRAVEL_DEL_URI", "\"http://uav.ningyingai.com/api/airway/del\""
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
release {
buildConfigField "String", "LOGIN_URI", "\"http://uav.ningyingai.com/api/user/login\""
buildConfigField "String", "REGISTER_URI", "\"http://uav.ningyingai.com/api/user/create\""
buildConfigField "String", "UPLOAD_FILE_URI", "\"http://uav.ningyingai.com/api/user/uploadFile\""
buildConfigField "String", "ADDINFO_URI", "\"http://uav.ningyingai.com/api/user/bindProduct\""
buildConfigField "String", "MODIFYINFO_URI", "\"http://uav.ningyingai.com/api/user/updateProduct\""
buildConfigField "String", "DELETEINFO_URI", "\"http://uav.ningyingai.com/api/user/deleteProduct\""
buildConfigField "String", "ONBROAD_URI", "\"http://uav.ningyingai.com/api/user/onbroadmsg\""
buildConfigField "String", "FLYRECORD_URI", "\"http://uav.ningyingai.com/api/user/flyRecord\""
buildConfigField "String", "FLYSTART_URI", "\"http://uav.ningyingai.com/api/uav/start\""
buildConfigField "String", "FLYEND_URI", "\"http://uav.ningyingai.com/api/uav/stop\""
buildConfigField "String", "PRODUCT_URI", "\"http://uav.ningyingai.com/api/user/product\""
buildConfigField "String", "TRAVEL_POST_URI", "\"http://uav.ningyingai.com/api/airway/record\""
buildConfigField "String", "TRAVEL_GET_URI", "\"http://uav.ningyingai.com/api/airway/get\""
buildConfigField "String", "TRAVEL_DEL_URI", "\"http://uav.ningyingai.com/api/airway/del\""
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
lintOptions {
abortOnError false
}
greendao {
schemaVersion 16//当前数据库版本
targetGenDir 'src/main/java'
}
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"
doNotStrip "*/*/libDJIFlySafeCore.so"
doNotStrip "*/*/libdjifs_jni.so"
doNotStrip "*/*/libsfjni.so"
doNotStrip "*/*/libDJICommonJNI.so"
doNotStrip "*/*/libDJICSDKCommon.so"
doNotStrip "*/*/libDJIUpgradeCore.so"
doNotStrip "*/*/libDJIUpgradeJNI.so"
doNotStrip "*/*/libDJIWaypointV2Core.so"
doNotStrip "*/*/libAMapSDK_MAP_v6_9_2.so"
doNotStrip "*/*/libDJIMOP.so"
doNotStrip "*/*/libDJISDKLOGJNI.so"
pickFirst 'lib/*/libstlport_shared.so'
pickFirst 'lib/*/libRoadLineRebuildAPI.so'
pickFirst 'lib/*/libGNaviUtils.so'
pickFirst 'lib/*/libGNaviMapex.so'
pickFirst 'lib/*/libGNaviData.so'
pickFirst 'lib/*/libGNaviMap.so'
pickFirst 'lib/*/libGNaviSearch.so'
pickFirst 'lib/*/libDJIFlySafeCore.so'
pickFirst 'lib/*/libdjifs_jni.so'
pickFirst 'lib/*/libsfjni.so'
exclude 'META-INF/proguard/okhttp3.pro'
exclude 'META-INF/rxjava.properties'
exclude 'assets/location_map_gps_locked.png'
exclude 'assets/location_map_gps_3d.png'
}
}
repositories{
flatDir {
dirs 'libs'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.core:core:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0-rc01'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation('com.dji:dji-sdk:4.15', {
/**
* Uncomment the "library-anti-distortion" if your app does not need Anti Distortion for Mavic 2 Pro and Mavic 2 Zoom.
* Uncomment the "fly-safe-database" if you need database for release, or we will download it when DJISDKManager.getInstance().registerApp
* is called.
* Both will greatly reducing the size of the APK.
*/
// exclude module: 'library-anti-distortion'
//exclude module: 'fly-safe-database'
})
compileOnly 'com.dji:dji-sdk-provided:4.15'
implementation('com.dji:dji-uxsdk:4.14', { exclude module: 'library-anti-distortion' exclude module: 'fly-safe-database' exclude module: 'dji-sdk'})
testCompile 'junit:junit:4.12'
compile 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation files('libs/dom4j-2.1.1.jar')
implementation files('libs/jsoup-1.12.1.jar')
implementation project(':thirdPart:easyDl')
implementation project(':thirdPart:common')
implementation project(':dialogtiplib')
implementation project(':thirdPart:camera_ui')
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation "io.reactivex.rxjava2:rxjava:$rootProject.ext.rxjava2Version"
implementation "com.squareup.retrofit2:retrofit:$rootProject.ext.retrofit2Version"
implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.ext.retrofit2Version"
implementation "com.squareup.retrofit2:converter-gson:$rootProject.ext.retrofit2Version"
implementation "com.google.code.gson:gson: $rootProject.ext.gsonVersion"
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
//dagger
compileOnly 'org.glassfish:javax.annotation:10.0-b28'
annotationProcessor 'com.google.dagger:dagger-compiler:2.21'
implementation 'com.google.dagger:dagger-android:2.21'
implementation 'com.google.dagger:dagger-android-support:2.21'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.21'
//加载框
implementation 'com.kaopiz:kprogresshud:1.2.0'
implementation 'org.greenrobot:greendao:3.3.0'
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.0.0-RC2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50'
implementation 'com.blankj:utilcodex:1.25.9'
implementation project(path: ':fileselectlibrary')
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
implementation 'com.github.bumptech.glide:glide:4.5.0'
implementation 'com.jaeger.statusbaruitl:library:1.3.6'
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
implementation('me.yokeyword:fragmentationx:1.0.2', {
})
implementation files('libs/jai-codec-1.1.3.jar')
implementation files('libs/jai_core-1.1.3.jar')
implementation files('libs/jai_imageio.jar')
compile project(path: ':maplib')
implementation 'com.tencent.bugly:crashreport_upgrade:1.5.0'
implementation files('libs/live-beauty-3.4.0.jar')
implementation files('libs/live-face-3.4.0.jar')
implementation files('libs/live-pusher-3.4.0.jar')
implementation(name: 'alivc-core-pusher', ext: 'aar')
implementation(name: 'AlivcPlayer', ext: 'aar')
implementation(name: 'AlivcReporter', ext: 'aar')
implementation(name: 'live-pusher-resources-3.4.0', ext: 'aar')
compile 'com.apkfuns.xprogressdialog:xprogressdialog:1.2.0'
implementation 'com.jankin.popupwindowcompat:lib:1.0.4'
implementation project(':audiolib')
implementation 'com.xw.repo:bubbleseekbar:3.20-lite'
compile 'com.github.Almeros:android-gesture-detectors:v1.0'
}
配置文件 -
我们按照这个配置都编译了一下,是没有问题的,目前只能检查一下项目的混淆文件是否有问题了。直接运行我们提供的 Sample 看看是否有问题。 链接:www.github.com/dji-sdk/Mobile-UXSDK-Android/blob/master/sample/app/build.gradle
Please sign in to leave a comment.
Comments
9 comments