Android i686 support

Issue #42 resolved
Igor Sereda created an issue

Originally reported on Google Code with ID 42

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

Reported by sereda on 2012-03-29 18:14:15

Comments (12)

  1. Igor Sereda reporter

    ``` 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 ```

    Reported by `sereda` on 2012-03-30 08:33:08

  2. Former user Account Deleted

    ``` 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. ```

    Reported by `dan.borza` on 2012-03-30 09:07:33

  3. Igor Sereda reporter

    ``` 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. ```

    Reported by `sereda` on 2012-03-30 09:22:51

  4. Former user Account Deleted

    ``` 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. ```

    Reported by `dan.borza` on 2012-03-30 09:46:40

  5. Former user Account Deleted

    ``` 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 ```

    Reported by `kozma.roland` on 2012-03-30 11:12:53

  6. Former user Account Deleted

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

    Reported by `robert.csiki` on 2012-03-30 21:48:23

  7. Former user Account Deleted

    ``` It works for me. I tried it on an Intel classmate tablet. ```

    Reported by `kozma.roland` on 2012-04-01 19:04:19

  8. Log in to comment