Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-2168

Warning : Linking against a dylib which is not safe for use in application extensions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 3.0
    • iOS
    • Security Level: Public
    • None
    • Jay 52
    • 5

    Description

      CBL iOS cannot be used in the app extensions. 

      Warning:
      Linking against a dylib which is not safe for use in application extensions: /Users/wayne/Library/Developer/Xcode/DerivedData/.../Debug-iphonesimulator/CouchbaseLiteSwift.framework/CouchbaseLiteSwift

      Currently, we are setting APPLICATION_EXTENSION_API_ONLY to NO. One of the reasons that we are setting it to NO is that we are using the sharedApplication object to detect whether the app is in the background or not for the replicator's backgrounding feature.

      It might be possible that we could remove this restriction by accessing sharedApplication dynamically and limit the backgrounding feature for app extension (not sure how to do it yet).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Build couchbase-lite-ios-3.0.0-236 contains couchbase-lite-ios commit d79d9c6 with commit message:
          CBL-2168: Add flag for app extension safe APIs (#2872)

          build-team Couchbase Build Team added a comment - Build couchbase-lite-ios-3.0.0-236 contains couchbase-lite-ios commit d79d9c6 with commit message: CBL-2168 : Add flag for app extension safe APIs (#2872)
          Jayahari.Vavachan Jay Vavachan added a comment -

          Tried with the attached project, with get the count from DB to display in extension, and then add more docs and replicate through Main project.

          I have enabled(here return NO) to make it work even in case of extension, which also didn't crashed. Assume this is because we are calling the sharedApplication dynamically(here)

          With the current checks, seems like it won't cause any trouble.
          https://github.com/snej/MYUtilities/blob/master/MYBackgroundMonitor.m#L47
          https://github.com/snej/MYUtilities/blob/master/MYBackgroundMonitor.m#L67
          https://github.com/snej/MYUtilities/blob/master/MYBackgroundMonitor.m#L81
          https://github.com/snej/MYUtilities/blob/master/MYBackgroundMonitor.m#L95

          Jayahari.Vavachan Jay Vavachan added a comment - Tried with the attached project, with get the count from DB to display in extension, and then add more docs and replicate through Main project. I have enabled( here return NO ) to make it work even in case of extension, which also didn't crashed. Assume this is because we are calling the sharedApplication dynamically( here ) With the current checks, seems like it won't cause any trouble. https://github.com/snej/MYUtilities/blob/master/MYBackgroundMonitor.m#L47 https://github.com/snej/MYUtilities/blob/master/MYBackgroundMonitor.m#L67 https://github.com/snej/MYUtilities/blob/master/MYBackgroundMonitor.m#L81 https://github.com/snej/MYUtilities/blob/master/MYBackgroundMonitor.m#L95
          Jayahari.Vavachan Jay Vavachan added a comment -

          We can try adding the config in parent project, and see
          https://github.com/couchbase/couchbase-lite-ios/pull/1415

          Jayahari.Vavachan Jay Vavachan added a comment - We can try adding the config in parent project, and see https://github.com/couchbase/couchbase-lite-ios/pull/1415

          I have not tried it recently (a year or two)

          priya.rajagopal Priya Rajagopal added a comment - I have not tried it recently (a year or two)

          Priya Rajagopal Have you seen this when you worked on the blog?

          pasin Pasin Suriyentrakorn added a comment - Priya Rajagopal  Have you seen this when you worked on the blog?

          Strangely the CBL Swift can be built with APPLICATION_EXTENSION_API_ONLY = YES. We will need to do more test if the actual library can be used or not. Also, this seems to be working in 2017 (https://blog.couchbase.com/couchbase-lite-with-ios-app-extensions/)

          pasin Pasin Suriyentrakorn added a comment - Strangely the CBL Swift can be built with APPLICATION_EXTENSION_API_ONLY = YES. We will need to do more test if the actual library can be used or not. Also, this seems to be working in 2017 ( https://blog.couchbase.com/couchbase-lite-with-ios-app-extensions/ )

          People

            Jayahari.Vavachan Jay Vavachan
            pasin Pasin Suriyentrakorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty