AmilyWang / sqlite4java

Automatically exported from code.google.com/p/sqlite4java
0 stars 0 forks source link

Android i686 support #42

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Build a binary for Android Intel-based architecture.

Quote from #29:
Any chance to support non-ARM Android platforms, such as GoogleTV? Here's the 
error I'm getting when deploying my test app on GoogleTV:

com.almworks.sqlite4java.SQLiteException: [-91] cannot load library: 
java.lang.UnsatisfiedLinkError: Couldn't load sqlite4java-android-i686: 
findLibrary returned null
  at com.almworks.sqlite4java.SQLite.loadLibrary(SQLite.java:97)
  at com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1314)
  at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:258)
  at com.robert.Test.<init>(Test.java:110)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load 
sqlite4java-android-i686: findLibrary returned null
  at java.lang.Runtime.loadLibrary(Runtime.java:425)
  at java.lang.System.loadLibrary(System.java:554)
  at com.almworks.sqlite4java.Internal.tryLoadFromSystemPath(Internal.java:349)
  at com.almworks.sqlite4java.Internal.loadLibraryX(Internal.java:124)
  at com.almworks.sqlite4java.SQLite.loadLibrary(SQLite.java:95)
  ... 8 more

Original issue reported on code.google.com by ser...@gmail.com on 29 Mar 2012 at 6:14

GoogleCodeExporter commented 8 years ago
URGENT... please hurry up....

Original comment by avcraciun@gmail.com on 30 Mar 2012 at 8:27

GoogleCodeExporter commented 8 years ago
I won't be able to work on this until sometime later. If someone could build 
this binary and post instructions to others, that would be great. 

Is it possible that linux binary would work? Try renaming 
libsqlite4java-linux-i386.so to libsqlite4java-android-i686.so

Original comment by ser...@gmail.com on 30 Mar 2012 at 8:33

GoogleCodeExporter commented 8 years ago
Thanks for your quick reply.

Unfortunately, renaming "libsqlite4java-linux-i386.so" to 
"sqlite4java-android-i686.so" won't do the trick for a x86 architecture.

A proper solution would be the recompilation of the native library.
Because I don't know how to do that, I'll try modifying the sqlite4java sources 
to load the the "libsqlite4java-linux-i386.so" library.

Original comment by dan.bo...@gmail.com on 30 Mar 2012 at 9:07

GoogleCodeExporter commented 8 years ago
It's libsqlite4java-android-i686.so not sqlite4java-android-i686.so. You can 
also rename it to just libsqlite4java.so. You can see which files it tries to 
load with "java -jar sqlite4java.jar -d" - no need to modify sources.

Original comment by ser...@gmail.com on 30 Mar 2012 at 9:22

GoogleCodeExporter commented 8 years ago
So, I've tried loading the "libsqlite4java-linux-i386.so" on a "android-i686" 
architecture by tricking the sqlite4java code to do that (I guess the same 
could be accomplished by explicitly setting the "sqlite4java.library.path" 
system property), but it didn't work. The library was found, but a different 
exception is thrown: 

Cannot load library: link_image[1966]:  2400 could not load needed library 
libc.so.6' for 'libsqlite4java-linux-i386.so' (load_library[1108]: Library 
'libc.so.6' not found)

So I guess the library needs to be recompiled for the android/i686 architecture 
as well. Cold you point us to instructions on how to do that?

Thanks,
Dan.

Original comment by dan.bo...@gmail.com on 30 Mar 2012 at 9:46

GoogleCodeExporter commented 8 years ago
Ok, that was expected. I don't have exactly the instructions you need, but see 
http://code.google.com/p/sqlite4java/issues/detail?id=29 and the attachment 
there - it's enough to build ARM binary, I guess it might work for i686 too. 

Original comment by ser...@gmail.com on 30 Mar 2012 at 9:53

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Yes, renaming libsqlite4java-linux-i386.so to libsqlite4java-android-i686.so 
won't do the trick. Exception:

03-30 11:06:32.720: E/f(3097): com.almworks.sqlite4java.s: [-91] cannot load 
library: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1966]: 
 2393 could not load needed library 'libc.so.6' for 
'libsqlite4java-android-i686.so' (load_library[1108]: Library 'libc.so.6' not 
found)

I'll try to do the build as suggested at 
http://code.google.com/p/sqlite4java/issues/detail?id=29

Thanks,
Roland

Original comment by kozma.ro...@gmail.com on 30 Mar 2012 at 11:12

GoogleCodeExporter commented 8 years ago
Hi, good news! 
I was able to build the library. I attached it here.

Thank you Igor!

Original comment by kozma.ro...@gmail.com on 30 Mar 2012 at 4:01

Attachments:

GoogleCodeExporter commented 8 years ago
Great! Thanks for posting it here

Original comment by ser...@gmail.com on 30 Mar 2012 at 4:16

GoogleCodeExporter commented 8 years ago
Hi Roland, can you confirm the posted lib works? I'll also try it myself on a 
Sony-made GoogleTV device, next week.

Original comment by robert.c...@gmail.com on 30 Mar 2012 at 9:48

GoogleCodeExporter commented 8 years ago
It works for me. I tried it on an Intel classmate tablet.

Original comment by kozma.ro...@gmail.com on 1 Apr 2012 at 7:04

GoogleCodeExporter commented 8 years ago

Original comment by evj...@almworks.com on 29 Oct 2014 at 10:44