I am very new to SQL Cipher. I read many stuff and implemented SQLCipher into my project.
I have put below JAR files into app/src/libs
I have put below file into app/src/main/assets
I have put below file into app/src/main/jniLibs
In Folder: armeabi
In Folder: armeabi-v7a
In Folder: x86
Below my gradle file in android studio.
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "abc.com.sqlcipher"
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
After this, i run my application and it gets crash every time with below error.
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/abc.com.sqlcipher-1/base.apk"],nativeLibraryDirectories=[/data/app/abc.com.sqlcipher-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "liblibstlport_shared.so"
After 4 to 5 hours, i got the solution from one of my friend.
Write below code into build.gradle file before android{} block.
repositories {
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
}
Write below line into dependencies {} block.
compile 'com.commonsware.cwac:sqlcipher-for-android:3.3.1'
Now you Sync your project then you can use SQL-Cipher Database into your application eaisly.