Any idea why I am having this cannot resolve symbol 'database' in net.sqlcipher
. I simply cloned SQLCipher Android Test from GitHub and wanted to test.
have also attached the screenshot for reference.
Thank you...
Any idea why I am having this cannot resolve symbol 'database' in net.sqlcipher
. I simply cloned SQLCipher Android Test from GitHub and wanted to test.
have also attached the screenshot for reference.
Thank you...
I am able to compile now after I've added compileOptions as JavaVersion 8 and enabled JACK
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Jack Options is added inside defaultConfig
jackOptions {
enabled true
}
Now my app/build.gradle
has become like this.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "net.zetetic.sqlcipher.test"
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// For testing zip-based distributions:
//compile files('libs/sqlcipher.jar')
// For testing AAR packages:
compile 'net.zetetic:android-database-sqlcipher:3.5.9@aar'
}
Thanks a lot for your helps guys.
import net.sqlcipher.database.SQLiteDatabase;
import net.sqlcipher.database.SQLiteOpenHelper;
DON'T
import android.database.Cursor;
DO
import net.sqlcipher.Cursor;
You should use
For app/build.gradle
section
compile (name: 'android-database-sqlcipher-3.5.9', ext: 'aar')
Add below project's build.gradle
file
repositories {
jcenter()
}
Then File-> Sync Project with Gradle Files
& Clean->Rebuild Project
.
Read SQLCipher for Android Application Integration
FYI
We initially tested adding Java 8 support via the Jack toolchain. Over time, we realized the cost of switching to Jack was too high for our community when we considered the annotation processors, bytecode analyzers and rewriters impacted. Thank you for trying the Jack toolchain and giving us great feedback. You can continue using Jack to build your Java 8 code until we release the new support. Migrating from Jack should require little or no work.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}