I am using greendao ORM. I am trying to encrypt my database using SQLCipher. Greendao automativally supports sqlcipher. So I wrote the following code for encryption.
DaoMaster.DevOpenHelper helper = new
MyDevOpenHelper(HuoYunApplication.getHuoYunApplicationContext(),
DBManager.DB_NAME, null);
Database db = helper.getEncryptedWritableDb(getEncryptedIMEI());
DaoSession daoSession = new DaoMaster(db).newSession();
return daoSession;
My app gradle dependencies are:-
compile rootProject.ext.dependencies["greendao"]
compile 'net.zetetic:android-database-sqlcipher:3.5.4'
However whenever I perform any database operation using this session,it gives an error which caused an crash when my app starts,Even it is not a crash about encryption or greendao itself,but about a third party "so" dependency:
04-19 10:49:08.524 26995-26995/com.wuba.huoyun E/CrashReport: # CRASH STACK: 04-19 10:49:08.524 26995-26995/com.wuba.huoyun E/CrashReport: java.lang.UnsatisfiedLinkError: No implementation found for long com.baidu.platform.comjni.map.commonmemcache.JNICommonMemCache.Create() (tried Java_com_baidu_platform_comjni_map_commonmemcache_JNICommonMemCache_Create and Java_com_baidu_platform_comjni_map_commonmemcache_JNICommonMemCache_Create__) at com.baidu.platform.comjni.map.commonmemcache.JNICommonMemCache.Create(Native Method) at com.baidu.platform.comjni.map.commonmemcache.a.a(Unknown Source) at com.baidu.platform.comapi.util.f.b(Unknown Source) at com.baidu.platform.comapi.a.c(Unknown Source) at com.baidu.platform.comapi.c.a(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source)
I have checked greendaodemo in their official website,and I believe that I have add sqlcipher dependence in right way.So is there any genus that can help us solve this problem?