Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating Realm.io on Eclipse

I'm attempting to integrate the Realm.io database into a fresh project on Eclipse however upon compilation the following error is thrown:

[2014-10-09 16:21:48 - DatabaseBenchmark] The library 'realm-0.71.0.jar' contains native libraries that will not run on the device.
[2014-10-09 16:21:48 - DatabaseBenchmark] Additionally some of those libraries will interfer with the installation of the application because of their location in lib/
[2014-10-09 16:21:48 - DatabaseBenchmark] lib/ is reserved for NDK libraries.
[2014-10-09 16:21:48 - DatabaseBenchmark] The following libraries were found:
[2014-10-09 16:21:48 - DatabaseBenchmark]  - lib/armeabi/libtightdb-jni.so
[2014-10-09 16:21:48 - DatabaseBenchmark]  - lib/armeabi-v7a/libtightdb-jni.so
[2014-10-09 16:21:48 - DatabaseBenchmark]  - lib/mips/libtightdb-jni.so
[2014-10-09 16:21:48 - DatabaseBenchmark]  - lib/x86/libtightdb-jni.so

Any thoughts on how to resolve this issue?


Edit: I've tried unchecking "Force error when external jars contain native libraries" in Eclipse->Preferences->Android->Build which did not change anything.

like image 813
Nyx Avatar asked Oct 09 '14 23:10

Nyx


1 Answers

That's a known problem with ADT. The Google team decided to disallow including native code in Jar files because they notices apps being published containing native code for Windows and Mac.

I'm working on solving the problem and I have a couple of pull requests fixing the issue. Once they will be merged in master and a new release is done (very soon) you will have to use the distribution package and move the contents of the eclipse folder into the libs folder.

You will also have to enable annotation processing in Eclipse, but we will provide detailed instructions on how to do that.

Another problem with Eclipse is that it uses its own annotation processor processor (!!!) which returns elements not in the order provided in the source code, but ordered by type. A workaround for that will also be released in 0.72.0

TL;DR Stay tuned for the next (and imminent) release of Realm.

like image 88
Emanuelez Avatar answered Oct 12 '22 10:10

Emanuelez