# Sqlcipher with robolectric

**URL:** <https://discuss.zetetic.net/t/sqlcipher-with-robolectric/5334>\
**Category:** Issues\
**Created:** [March 21, 2022, 11:05pm UTC](https://discuss.zetetic.net/t/sqlcipher-with-robolectric/5334 "2022-03-21T23:05:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doli](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/doli/32/1761_2.png) [@Doli](https://discuss.zetetic.net/u/Doli)\
**Post date:** [March 21, 2022, 11:05pm UTC](https://discuss.zetetic.net/t/sqlcipher-with-robolectric/5334/1 "2022-03-21T23:05:36Z")

</div>

I have sqlcipher integrated in my android application but when I try to run a existing test case now, I get following error:  
java.lang.UnsatisfiedLinkError: no sqlcipher in java.library.path

```auto
no sqlcipher in java.library.path: [C:\Program Files\Android\Android Studio3\jre\bin, C:\Windows\Sun\Java\bin, C:\Windows\system32, C:\Windows, c:\program files (x86)\smartbear\testcomplete 14\bin, c:\program files (x86)\smartbear\testcomplete 14\x64\bin, C:\ActiveTcl\bin, C:\Users\abc\AppData\Local\Android\Sdk\platform-tools, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0\, C:\Windows\System32\OpenSSH\, C:\Program Files (x86)\Borland\CaliberRM SDK 2008\lib, C:\Program Files\PuTTY\, C:\Program Files\dotnet\, C:\Program Files\Microsoft SQL Server\130\Tools\Binn\, C:\Users\abc\AppData\Local\Programs\Python\Python37\, C:\Program Files\Microsoft SQL Server\120\Tools\Binn\, C:\Users\abc\.dnx\bin, C:\Program Files\Microsoft DNX\Dnvm\, C:\Strawberry\c\bin, C:\Strawberry\perl\site\bin, C:\Strawberry\perl\bin, C:\Program Files (x86)\Gpg4win\..\GnuPG\bin, C:\Program Files (x86)\dotnet\, C:\Users\abc\AppData\Local\Microsoft\WindowsApps, C:\Users\abc\AppData\Local\atom\bin, .]
java.lang.UnsatisfiedLinkError: no sqlcipher in java.library.path: [C:\Program Files\Android\Android Studio3\jre\bin, C:\Windows\Sun\Java\bin, C:\Windows\system32, C:\Windows, c:\program files (x86)\smartbear\testcomplete 14\bin, c:\program files (x86)\smartbear\testcomplete 14\x64\bin, C:\ActiveTcl\bin, C:\Users\abc\AppData\Local\Android\Sdk\platform-tools, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0\, C:\Windows\System32\OpenSSH\, C:\Program Files (x86)\Borland\CaliberRM SDK 2008\lib, C:\Program Files\PuTTY\, C:\Program Files\dotnet\, C:\Program Files\Microsoft SQL Server\130\Tools\Binn\, C:\Users\abc\AppData\Local\Programs\Python\Python37\, C:\Program Files\Microsoft SQL Server\120\Tools\Binn\, C:\Users\abc\.dnx\bin, C:\Program Files\Microsoft DNX\Dnvm\, C:\Strawberry\c\bin, C:\Strawberry\perl\site\bin, C:\Strawberry\perl\bin, C:\Program Files (x86)\Gpg4win\..\GnuPG\bin, C:\Program Files (x86)\dotnet\, C:\Users\abc\AppData\Local\Microsoft\WindowsApps, C:\Users\abc\AppData\Local\atom\bin, .]
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2670)
	at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
	at java.base/java.lang.System.loadLibrary(System.java:1873)
	at net.sqlcipher.database.SQLiteDatabase$1.loadLibraries(SQLiteDatabase.java:227)
	at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:244)
	at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:223)
	at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:216)
	at com.abcd.ab.database.AuditTrailLogger.insertAudit(AuditTrailLogger.java:208)
	at com.abcd.ab.database.AuditTrailLogger.auditQcUnlock(AuditTrailLogger.java:181)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:546)
	at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:252)
	at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:89)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

```

There is related issue I saw which was 6 years ago. Has the answer changed since then, is there any better solution to this problem.

> [@How to hide or exclude sqlcipher from robolectric?](https://discuss.zetetic.net/t/how-to-hide-or-exclude-sqlcipher-from-robolectric/1782):
>
> We were working on building a significant new feature for our app. To speed development, we tried to build the feature independently of our app, and then bring it over. Worked for iOS, not so much for Android. Current issue is that the test suite is written using Robolectric for speed of running the tests…however, now that we’re trying to run the tests in the full app, we realise that we didn’t use sqlcipher in the independent build. So, when I try to run a test case now, I get this error: …

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [March 22, 2022, 1:14pm UTC](https://discuss.zetetic.net/t/sqlcipher-with-robolectric/5334/2 "2022-03-22T13:14:36Z")

</div>

Hi @Doli

Unfortunately not, the same answer stands. SQLCipher for Android contains native libraries that are built to run on various Android platform devices, however, that excludes the desktop JVM.
