Unable to load sqlite_jni: java.lang.UnsatisfiedLinkError

348 views
Skip to first unread message

Christian Tucker

unread,
Jan 9, 2016, 2:06:05 AM1/9/16
to RoboVM
I was copying the implementation of SQLite from the ContractR example and ran into this issue which I have not been able to fix.

Unable to load sqlite_jni: java.lang.UnsatisfiedLinkError: Couldn't load sqlite_jni from loader java.lang.BootClassLoader[/Users/christiantucker/Library/Developer/CoreSimulator/Devices/57856A44-1E5F-4E4F-BFDC-A8D3C7DDF373/data/Containers/Bundle/Application/03E7BA82-8539-43C4-AE28-ADA1A761EEA5/Main.app/lib/boot/robovm-rt.jar:/Users/christiantucker/Library/Developer/CoreSimulator/Devices/57856A44-1E5F-4E4F-BFDC-A8D3C7DDF373/data/Containers/Bundle/Application/03E7BA82-8539-43C4-AE28-ADA1A761EEA5/Main.app/lib/boot/robovm-cacerts-full.jar]: findLibrary returned null


As you can see I have a fairly simple setup. I've made sure that all of the dependencies were configured correctly in Gradle and by checking the project properties. This code is in the CORE project. 
Message has been deleted

Christian Tucker

unread,
Jan 9, 2016, 2:21:30 AM1/9/16
to RoboVM
Here is the directory of the file: 

Using db in file: /Users/christiantucker/Library/Developer/CoreSimulator/Devices/57856A44-1E5F-4E4F-BFDC-A8D3C7DDF373/data/Containers/Data/Application/219D423C-B80F-4EAC-A62B-44D047585271/Documents/mydb.sqlite

I'm using the 

<forceLinkClasses>
<pattern>SQLite.**</pattern>
    ...
</forceLinkClasses>

-------

testCompile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.7.2'

Niklas Therning

unread,
Jan 11, 2016, 2:02:49 AM1/11/16
to Christian Tucker, RoboVM
What happens after you see this message? Crash? Do you get a stacktrace?

In the ContractR sample you see this message as well but the app works. The reason is that the sqlite lib first tries to load the sqlite dynamic library. But since the lib has been compiled in statically already that fails of course. The driver does recover from that though and uses the statically linked native methods. I see no reason why this shouldn't work when you package your app as a framework as well.

--
You received this message because you are subscribed to the Google Groups "RoboVM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robovm+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christian Tucker

unread,
Jan 12, 2016, 10:46:54 PM1/12/16
to RoboVM, christia...@outlook.com
Because of the way that I had added my logic into the application (Following the connection attempt in the try/catch, instead of creating another one) this error would prevent any additional logic (Such as creating the schema) from executing. Moving the additional logic outside of the try/catch block and into its own try/catch block for SQLException's seems to work fine. Thank you for the explanation on the issue, everything is working fine, and I just had everything set up incorrectly. 
Reply all
Reply to author
Forward
0 new messages