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

          pasin Pasin Suriyentrakorn created issue -

          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/ )
          pasin Pasin Suriyentrakorn made changes -
          Field Original Value New Value
          Summary Linking against a dylib which is not safe for use in application extensions Warning : Linking against a dylib which is not safe for use in application extensions
          pasin Pasin Suriyentrakorn made changes -
          Description CBL iOS cannot be used in the app extensions. 

          Error:
          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).
          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).

          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?

          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)
          Jayahari.Vavachan Jay Vavachan made changes -
          Rank Ranked higher
          Jayahari.Vavachan Jay Vavachan made changes -
          Assignee The Lite [ cbgto ] Jay Vavachan [ jayahari.vavachan ]
          Jayahari.Vavachan Jay Vavachan made changes -
          Story Points 5
          jimb Jim Borden made changes -
          Sprint Jay 52 [ 1709 ]
          jimb Jim Borden made changes -
          Rank Ranked lower
          Jayahari.Vavachan Jay Vavachan made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          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
          Jayahari.Vavachan Jay Vavachan made changes -
          Attachment App.zip [ 153765 ]
          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 made changes -
          Status In Progress [ 3 ] In Review [ 10107 ]
          Jayahari.Vavachan Jay Vavachan made changes -
          Status In Review [ 10107 ] In Progress [ 3 ]
          Jayahari.Vavachan Jay Vavachan made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          Jayahari.Vavachan Jay Vavachan made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

          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 made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Jayahari.Vavachan Jay Vavachan made changes -
          Affects Version/s 2.8.0 [ 16189 ]
          Affects Version/s Lithium [ 16190 ]
          Jayahari.Vavachan Jay Vavachan made changes -
          Issue Type Task [ 3 ] Bug [ 1 ]
          Jayahari.Vavachan Jay Vavachan made changes -
          Required Mobile Fields Mandatory:
           - CBL / SG Version:
             - SG Config:
           - Steps to Reproduce:
           - Actual Result:
           - Expected Result:
           - Logs :
                SGW LOGS: sgcollect info
                CBL LOGS:
                Logcat LOGS: for Android tickets
           - Github link for the code:
           - Jenkins job failure link:
           - Pytest Command
           - What is the last build this test passed:
          Jayahari.Vavachan Jay Vavachan made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]
          Jayahari.Vavachan Jay Vavachan made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

          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