`couldn't find native method` issues with Android 4.4.2 and SQLCipher v3.2.0

Hi there,

I am looking forward to getting SQLCipher v3.2.0 working with my application on Android 4.4.2 but am running into an issue. The following error occurs as the main activity calls the SQLiteDatabase.loadLibs(this) method in it’s onCreate callback:

10-22 11:37:14.045: E/dalvikvm(6692): ERROR: couldn't find native method
10-22 11:37:14.045: E/dalvikvm(6692): Requested: Lnet/sqlcipher/database/SQLiteDatabase;.native_execSQL:(Ljava/lang/String;)V
10-22 11:37:14.060: E/dalvikvm(6692): VM aborting

Using the adb shell I verified that the native libraries are being installed. So under /data/data/<package>/lib, ls yields:


As a precaution I have also included -keep class net.sqlcipher.** in the ProGuard options.

Any suggestions or thoughts?

Many thanks,

Hello @jamesvoth

To help diagnose this specific situation, does your application behave correctly without running ProGuard?

Hi @developernotes,

Unfortunately that will be difficult to do since this is a Scaloid project (i.e. written in Scala) and without ProGuard I run into ‘Too many methods’ errors.

Perhaps I’ll see if including the -keep* options specified in proguard-project.txt from the sqlcipher/android-database-sqlcipher GitHub repo in my project’s ProGuard options yields any success.

Kind regards,

Hi @jamesvoth

We include a sample ProGuard file with SQLCipher for Android here, could you take a look at that, integrating any differences you notice into your ProGuard file?

Hello @developernotes,

I have included all of the -keep* options from the ProGuard file you referenced and that seems to have solved the problem.

Many thanks for your help,

Hi @jamesvoth

We are glad to hear you were able to resolve the issue. Take care!

Hi, in the proguard-project.txt linked above (https://github.com/sqlcipher/android-database-sqlcipher/blob/master/proguard-project.txt), what are the really needed options to run SQLCipher w/ Proguard safely? I don’t want to include options that are unecessary. Many thanks.

Hello @Giuseppe_Calaprice

I am not aware of anything specifically redundant there, we have just provided a sample as users have asked for it. Feel free to make any adjustments for your specific application.