[Android] couldn't find "libmds.so"
Hello,
I'm trying to develop on an LG 7 One running Android 10. But I run into the following error when I try to initialize an mds object. What is not working?
E/SDSInternalWrapper: System.loadLibrary(mds) FAILED! Error: sds: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/cardiovelo.ca.rpm_dev_01.debug-nbLNeDZ-bOis9O8hobaBMw==/base.apk"],nativeLibraryDirectories=[/data/app/cardiovelo.ca.rpm_dev_01.debug-nbLNeDZ-bOis9O8hobaBMw==/lib/arm64, /system/lib64, /system/product/lib64]]] couldn't find "libmds.so"
In Project Structure (contextual menu → Open Module Settings), module “mdslib-1.28.1(1)-release” is added and dependence adjusted accordingly.
Here is “build.gradle (Module: app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "cardiovelo.ca.rpm_dev_01"
minSdkVersion 24
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix ".debug"
debuggable true
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// RxAndroidBle
implementation 'com.polidea.rxandroidble:rxandroidble:1.4.3'
implementation 'io.reactivex:rxandroid:1.2.1'
// GSON
implementation 'com.google.code.gson:gson:2.8.6'
// Movesense .aar lib
implementation project(path: ':mdslib-1.28.1(1)-release')
}
Comments (3)
-
reporter -
reporter You can mark the outcome as resolved. The main problem was 18 '' in front of the screen! First, do not root cell phone. It really isn't necessary. I did not do it! Also, don't buy another phone. This too is really not necessary. The problem was rather related to the position of the mdslib library file in relation to the Android project directory and also to the version of gradle used.
-
- changed status to resolved
Thank you for finding out and documenting what was wrong! Also I'd recommend updating to a much newer MDS, latest is 1.39...
- Log in to comment
The problem seems to be with the write access right in one of the /system directories on my LG 7 One. If I make an APK package with my program and install it manually, the program works! But if I try to run from Android Studio, then I have the error mentioned.
Very frustrating. One solution would probably be to "root" the phone. Unfortunately, this seems like a very bad adventure to undertake with an LG 7 One. I am considering buying a phone that is already "rooted" just for development.
If not, is it possible to define a user directory to deposit the library there?