我正在使用greendao ORM。我正在尝试使用 SQLCipher 加密我的数据库。Greendao 自动支持 sqlcipher。所以我写了下面的代码进行加密。
DaoMaster.DevOpenHelper helper = new
MyDevOpenHelper(HuoYunApplication.getHuoYunApplicationContext(),
DBManager.DB_NAME, null);
Database db = helper.getEncryptedWritableDb(getEncryptedIMEI());
DaoSession daoSession = new DaoMaster(db).newSession();
return daoSession;
我的应用程序 gradle 依赖项是:-
compile rootProject.ext.dependencies["greendao"]
compile 'net.zetetic:android-database-sqlcipher:3.5.4'
但是,每当我使用此会话执行任何数据库操作时,它都会在我的应用程序启动时出现导致崩溃的错误,即使它不是关于加密或 greendao 本身的崩溃,而是关于第三方“so”依赖:</p>
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() (已尝试 Java_com_baidu_platform_comjni_map_commonmemcache_JNICommonMemCache_Create 和 Java_com_baidu_platform_comjni_map_commonmemcache_JNICommonMemCache_Create__)在 com.baidu.platform.commonmemcacheCreate()NICommonMemCache_Create__)。在 com.baidu.platform.comjni.map.commonmemcache.aa(Unknown Source) at com.baidu.platform.comapi.util.f.b(Unknown Source) at com.baidu.platform.comapi.ac(Unknown Source) at com.baidu.platform.comapi.ca(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source) at com. baidu.mapapi.SDKInitializer.initialize(未知来源)a(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source)a(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source) at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source)
我在他们的官网上查了greendaodemo,我相信我已经以正确的方式添加了sqlcipher依赖。那么有没有什么属可以帮助我们解决这个问题?