A newer version of this documentation is available.

View Latest

Install Couchbase Lite on Swift

    March 16, 2025
    + 12

    Description — Installing Couchbase Lite on Swift

    Get Started

    Create or open an existing Xcode project and install Couchbase Lite using one of the Install Methods methods shown.

    Xcode 12.3 Work Around

    If you have downloaded a .framework package to install, you may be impacted by an existing issue in Xcode 12.3. The issue prevents use of certain frameworks, displaying the error: Building for iOS Simulator, but the linked framework was built for iOS — see: Apple Developer Forum.

    The recommended solution is to use an .xcframework package, where possible. Alternatively, as an interim solution, you can do the following workaround in your Xcode project:

    1. Navigate to the target’s Build Settings

    2. Locate the Validate Workspace setting

      xcode 12x3 fix
    3. Set Validate Workspace to Yes, then return it to No

    Install Methods

    1. Download Couchbase Lite.

    2. Unzip the file

    3. Drag CouchbaseLiteSwift.framework from your Finder to the Xcode navigator.

    4. Click on Project > General > Embedded Binary and add CouchbaseLiteSwift.framework to this section.

    5. Import the framework

      swift
      import CouchbaseLiteSwift ...
    6. Start using Couchbase Lite on Swift in your project.