Skip to content

Native Libraries

Alexandr Esilevich edited this page Apr 1, 2024 · 21 revisions

This article describes how to use native prebuilt libraries with the Swift toolchain for Android. An example of such a library is the sqlite3 library, which is required for using the GRDB.swift and SQLite.swift libraries.

There are two ways to use native libraries in SPM projects:

  1. The .systemLibrary SPM target
  2. The .binaryTarget SPM target

The scd build tool from the Swift toolchain for Android supports both methods and automatically embeds all required dynamic libraries into the resulting Android archive.

Using the .systemLibrary SPM target

Using the .binaryTarget SPM target

Clone this wiki locally