A newer version of this documentation is available.

View Latest

Installation - Couchbase Lite on Objective-C

      +

      Description — Installing Couchbase Lite on Objective-C

      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

      • Frameworks

      • Carthage

      • CocoaPods

      • Download Couchbase Lite.

      • Drag CouchbaseLite.framework from your Finder to the Xcode navigator.

      • Click on Project > General > Embedded Binary and add CouchbaseLite.framework to this section.

      • Import the framework and start using it in your project.

        #include <CouchbaseLite/CouchbaseLite.h>
        ...
      1. Install Carthage

      2. In your Cartfile, add the following.

        Couchbase Lite Community Edition
        binary "https://packages.couchbase.com/releases/couchbase-lite-ios/carthage/CouchbaseLite-Community.json" ~> 2.8
        Couchbase Lite Enterprise Edition
        binary "https://packages.couchbase.com/releases/couchbase-lite-ios/carthage/CouchbaseLite-Enterprise.json" ~> 2.8
      3. Run carthage update --platform ios.

      4. Drag CouchbaseLite.framework from Carthage/Build/ to the Xcode navigator.

      5. Click on Project > General > Embedded Binary and add CouchbaseLite.framework to this section.

      1. Install Cocoapods

      2. In your Podfile, add the following.

        Couchbase Lite Community Edition
        target '<your target name>' do
          use_frameworks!
          pod 'CouchbaseLite', '~> 2.8'
        end
        Couchbase Lite Enterprise Edition
        target '<your target name>' do
          use_frameworks!
          pod 'CouchbaseLite-Enterprise', '~> 2.8'
        end
      3. Install the pods and open the .xcworkspace file generated by Cocoapods.

        pod install