Firebird embedded on Android

49 views
Skip to first unread message

Tomasz Tyrakowski

unread,
Nov 20, 2025, 5:59:00 AMNov 20
to firebird-support
Hi,

One of the users of my Dart/Flutter Firebird client reported problems
with Firebird embedded on Android. The error he got is the same as
reported last month in this thread:

https://groups.google.com/g/firebird-support/c/SNQZZ3ptNk4

(could not find acceptable ICU library). The thread above is related to
.NET provider, while the error reported to me has nothing to do with
.NET. It appears when attaching to an existing database (which might be
explainable by ICU mismatch on database level and fixable with gfix
-icu), as well as when creating a new database (and the aforementioned
explanation doesn't apply here).

So, my question is: is there a working app / project / demo / test app,
with source code available for reference, which uses Firebird embedded
on Android, that actually works? In any language / SDK?
I've checked that ICU 6.3 libraries are included in the embedded aar
archive downloadable from firebirdsql.org (FB 5.0.3 embedded for
Android) and the libraries get copied to proper locations inside the
resulting apk when building the app. But maybe, at runtime, somehow the
embedded engine doesn't load those libraries and tries to load the
system-wide ICU from local Android, which results in a version mismatch.
A proof of concept working app would be helpful for reference (there
doesn't seem to be one in Firebird examples or perhaps I don't know
where to look), so if anyone knows of such a project, please do let me know.

Thanks in advance.

regards
Tomasz

Tomasz Tyrakowski

unread,
Nov 23, 2025, 10:14:42 AMNov 23
to firebird...@googlegroups.com
On 20.11.2025 at 11:58, Tomasz Tyrakowski wrote:
> So, my question is: is there a working app / project / demo / test app,
> with source code available for reference, which uses Firebird embedded
> on Android, that actually works? In any language / SDK?
> I've checked that ICU 6.3 libraries are included in the embedded aar
> archive downloadable from firebirdsql.org (FB 5.0.3 embedded for
> Android) and the libraries get copied to proper locations inside the
> resulting apk when building the app. But maybe, at runtime, somehow the
> embedded engine doesn't load those libraries and tries to load the
> system-wide ICU from local Android, which results in a version mismatch.
> A proof of concept working app would be helpful for reference (there
> doesn't seem to be one in Firebird examples or perhaps I don't know
> where to look), so if anyone knows of such a project, please do let me
> know.

After some more tinkering I'm still unable to make Android embedded
work. No matter what I do, when attaching to the database I get back
error 335545167 ("Could not find acceptable ICU library").
I've tried it on Android 13 to 16 (emulated) and Android 15 (physical
device), using the official 5.0.3 embedded aar from firebirdsql.org.
I've even changed the icu_versions in assets/firebird/fbintl.conf inside
the aar from "default" to "63.1" (to match the libicu libraries shipped
inside the aar), but the outcome is always the same.
As far as I can tell, the application successfully loads libfbclient.so,
so it finds the client library (deployed from the aar) for the correct
architecture in the installed app bundle.
This web page:
https://developer.android.com/guide/topics/resources/internationalization
lists the ICU versions installed system-wide on different Android
versions. No Android version ships 63.1 (the closest is Android 10 with
63.2), Android 13 has 70.1, Android 15 has 75.1.
I've analyzed unicode_util.cpp in the Firebird sources and it looks like
UnicodeUtil::getConversionICU() tries different ICU versions until one
of them can be loaded. If none can, the isc_icu_library error gets thrown.
The preferred version is 63.1, which is the very version shipped in the
embedded aar, but somehow the engine (or libfbclient) doesn't see those
libraries or doesn't attempt to load it.

So, I come back to my original question: does embedded Firebird on
Android actually work, if it does, does it require some special
initialization in the application code, apart from loading libfbclient
and accessing its interfaces (mater, util, provider, etc.), just like in
a standard client-server version?
Is there a working example or a test suite that proves it really works
on Android (can it attach to employee.fdb in embedded mode)?

Don't get me wrong, I'm not trying to force any confessions, it's just
that if you guys know it doesn't work at the moment (e.g. due to ICU
problems), it would save my time trying to find a fix or a workaround.

regards
Tomasz


Tomasz Tyrakowski

unread,
Nov 23, 2025, 1:00:36 PMNov 23
to firebird...@googlegroups.com
On 23.11.2025 at 16:14, Tomasz Tyrakowski wrote:
> After some more tinkering I'm still unable to make Android embedded
> work. No matter what I do, when attaching to the database I get back
> error 335545167 ("Could not find acceptable ICU library").
> I've tried it on Android 13 to 16 (emulated) and Android 15 (physical
> device), using the official 5.0.3 embedded aar from firebirdsql.org.
> I've even changed the icu_versions in assets/firebird/fbintl.conf inside
> the aar from "default" to "63.1" (to match the libicu libraries shipped
> inside the aar), but the outcome is always the same.
> As far as I can tell, the application successfully loads libfbclient.so,
> so it finds the client library (deployed from the aar) for the correct
> architecture in the installed app bundle.

A quick update.

Tried one more thing: loading the bundled libicui18n.63.1.so by hand
(Dart's DynamicLibrary.load, which internally calls dlopen) in the
Android app. That's the error I get:

ArgumentError (Invalid argument(s): Failed to load dynamic library
'libicui18n.63.1.so': dlopen failed: library "libicuuc.so.63" not found:
needed by
/data/app/~~2mj0H6-WkpBmgGyzC6Mzbw==/com.example.fbdbmobdemo-DBmNeqccYoLg53KDA5hbeA==/base.apk!/lib/x86_64/libicui18n.63.1.so
in namespace classloader-namespace)

It seems like the Android version of libicui18n.63.1.so (shipped with
the Firebird embedded aar) references by name libicuuc.so.63 (and it
does, a text search for libicuuc.so.63 in libicui18n.63.1.so shows a
match), but there's no such library present in the aar bundle.
I'm trying currently to mess with the aar and place copies of the
.63.1.so libraries under .so.63 names, but it seems files other than .so
don't get copied to the jni native library dirs of the resulting apk (or
at least I don't know how to make Flutter do that during build, but
working on it).

So, there's a clue to what's wrong with the icu libraries in the aar,
but I'm not sure how it can be fixed (other than during the Firebird
build process). I also suspect the current version of Firebird embedded
package for Android is just broken.
However, before I create a GitHub issue for it, I'd like someone to
confirm my line of thinking (or prove me wrong; personally I'd prefer
the latter ;) ).

regards
Tomasz

Marsupilami79

unread,
Nov 25, 2025, 7:38:55 AMNov 25
to firebird...@googlegroups.com
Hello Tomasz,

some time ago I got Firebird 4 to work on Android in embedded mode. I
didn't use the aar file then but used the regluar distribution. See the
following link for what I did on Delphi:
https://sourceforge.net/p/zeoslib/wiki/How%20to%20use%20Firebird%204.0%20with%20Zeos%20on%20Android/

If the instructions are out of date, let me know. I use Firebird 4.0.5
in two of my current Android apps.

I didn't try this with Firebird 5, but I am sure, it can be done there too.

Best regards,

Jan

Tomasz Tyrakowski

unread,
Nov 25, 2025, 8:55:03 AMNov 25
to firebird...@googlegroups.com
On 25.11.2025 at 13:37, 'Marsupilami79' via firebird-support wrote:
> some time ago I got Firebird 4 to work on Android in embedded mode. I
> didn't use the aar file then but used the regluar distribution. See the
> following link for what I did on Delphi:
> https://sourceforge.net/p/zeoslib/wiki/
> How%20to%20use%20Firebird%204.0%20with%20Zeos%20on%20Android/
>
> If the instructions are out of date, let me know. I use Firebird 4.0.5
> in two of my current Android apps.
>
> I didn't try this with Firebird 5, but I am sure, it can be done there too.
I'm working on it, Adriano provided some valuable instructions. I didn't
realize Firebird assets needed to be copied out from the app bundle to a
location in the device filesystem, otherwise Firebird engine cannot
access them.
Thanks for your response, I'll post a summary when I finally get it
working (and will take a look at the code you kindly provided if I get
stuck).
I just need some time to do it properly, because I work with
Dart/Flutter code, which is multiplatform, and the extra setup required
by Fierebird embedded on Android is supposed to be done, well, only on
Android ;)
As for the ICU libraries on Android, they do work if they're loaded in
the proper order (icudata first, then icuuc, and icui18n last).
If you try to load just i18n, you get the dlopen error from my previous
posts, because the Android dynamic loader then tries to locate the other
libraries (that i18n depends on) by their internal names (xx.so.63
instead of xx.63.1.so) and fails. If they're already loaded, the loader
doesn't need to look for them again.

Thanks again for your response.

regards
Tomasz
Reply all
Reply to author
Forward
0 new messages