3

I'm using a third-party library to detect Multiple sims for both older versions of android and newer versions found from here: https://stackoverflow.com/a/41544422/1860982 by @Tapa Save But on adding the library to my dependencies and trying to run it throws an exception that it cannot find library.

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.kirianov.multisim:multisim:1.0'
}

It just crashes and shows me this error

java.lang.UnsatisfiedLinkError: Couldn't load multisimlib from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.sampleapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.sampleapp-2, /vendor/lib, /system/lib]]]: findLibrary returned null

So i checked many sources on stackoverflow related to this issue, but none helped yet.

Community
  • 1
  • 1
Tosin Onikute
  • 3,883
  • 6
  • 38
  • 61
  • Please try use: compile 'com.kirianov.multisim:multisim:2.0@aar' – Tapa Save Jan 28 '17 at 10:25
  • Still not work on android above 6.0 (run time permissions request), but I work on this issue – Tapa Save Jan 28 '17 at 10:26
  • @TapaSave Thanks, But i got this error while trying to sync Error:(23, 13) Failed to resolve: com.kirianov.multisim:multisim:2.0 – Tosin Onikute Jan 28 '17 at 18:51
  • you use '@aar' suffix? – Tapa Save Jan 28 '17 at 18:52
  • @TapaSave Yea, i used this exactly compile 'com.kirianov.multisim:multisim:2.0@aar' – Tosin Onikute Jan 28 '17 at 19:05
  • Please try again, now it is available from jcenter – Tapa Save Feb 06 '17 at 08:32
  • @TapaSave thanks, I tried it now & it gave the good results. I got output on my console like this : "I/MultiSim++: SLOT [0]". Which was obviously printing from your class as using MultiSim++ as your String TAG. But your sample implementation did not output anything using this "multiSimTelephonyManager.sizeSlots()"; It was returning 0; I am referring you your implementation as you stated here: http://stackoverflow.com/a/41544422/1860982 – Tosin Onikute Feb 06 '17 at 16:58
  • I update snippet in link above, you need run 'multiSimTelephonyManager.update();' and create 'BroadcastReceiver' for get new informations when device state changed or multiSimTelephonyManager launched firstly. – Tapa Save Feb 06 '17 at 17:43

1 Answers1

0

you might want to try adding multidex and adding mavenCentral() to project gradle

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
        dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'

    }
}

to add multidex follow https://developer.android.com/studio/build/multidex.html