CareKit icon indicating copy to clipboard operation
CareKit copied to clipboard

Static Library error

Open codemechanica opened this issue 5 years ago • 3 comments

Environment: Mac OS Catalina Version 10.15.6 Xcode 12.0 beta 4

Added the CareKit 2.0.1 package and getting errors. Unable to build and run

Screen Shot 2020-08-07 at 1 21 54 PM

codemechanica avatar Aug 07 '20 04:08 codemechanica

Can you give more details about how you added CareKit? Did you add it as a SPM package or a Xcode subproject?

erik-apple avatar Aug 13 '20 23:08 erik-apple

@fmigsystems Is this still a problem for you? We have not been able to reproduce this in Xcode 12.0 beta 4 or beta 5.

erik-apple avatar Aug 21 '20 22:08 erik-apple

@eric-apple, I have also encountered this problem and have a use case that should be reproducible. I was working on refactoring my application to create SPM packages to collect reusable CareKit functionality. I created a Package, e.g. CareKitUtil, that imports CareKit via SPM. I then import CareKitUtil (using SPM) into my application that also imports CareKit. This scenario should produce a similar static library error as described by the original issue.

After some research, it appears that it's recommended to define Package libraries as .dynamic instead of .static

products: [

    .library(

        name: "CareKit",

type: .dynamic,

        targets: ["CareKit"]),

This change resolves my static library build error for this scenario. However, I still get a similar error if I import only CareKitStore into my CareKitUtil reusable package, instead of importing CareKit. Can/should all three of the framework packages be defined as type: .dynamic? Unsure if this will create issues for existing user configuration.

Thanks for an awesome CareKit framework!! Dave

On Fri, Aug 21, 2020 at 4:44 PM erik-apple [email protected] wrote:

@fmigsystems https://github.com/fmigsystems Is this still a problem for you? We have not been able to reproduce this in Xcode 12.0 beta 4 or beta 5.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/carekit-apple/CareKit/issues/493#issuecomment-678545776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKEBNHLIQHPO7BCTJTNVRB3SB32GFANCNFSM4PXHR4ZQ .

drdavec avatar Aug 23 '20 18:08 drdavec