fit-objective-c-sdk "Couldn't load project at:" error

Hi - I am using your new fit-objective-c-sdk Swift Package in a development to write FIT files on iOS - I was super happy to see you had made this available!

But I am experiencing an error I have been unable to find a solution for - in the Issue Navigator I see this error when I add the package:

"/Users/rcfox/Library/Developer/Xcode/DerivedData/RC-beraxgvhczbwnebxaqduazrfmufp/SourcePackages/checkouts/fit-objective-c-sdk/Sources/cppfit/include Couldn't load project at: /Users/rcfox/Library/Developer/Xcode/DerivedData/RC-beraxgvhczbwnebxaqduazrfmufp/SourcePackages/checkouts/fit-objective-c-sdk/Sources/cppfit/include"

and the Project navigator shows the cppfit/include directory to be empty (see attached screenshot).

This is especially problematic for me because there are many definitions and symbols in the header files in that directory that I will need to use, for example, the 

FIT_UINT16 FIT_MANUFACTURER values.

I am using Xcode 14.1 (14B47b)

Thanks.

  • I have yet to figure out why that folder is not loaded in the IDE and gives that error/warning. It does not affect builds or running the tests but is annoying nonetheless. The error/warning is also transient. It comes and goes and we don't know why. You can see it listed in the package file, and the header files are all well formed. 

    However, the file you are looking for is ObjcFIT/include/FITTypes.h. That file has all of the types you are looking for under the cpp/include folder but with Objective-C naming conventions. Apple recommends we use a three letter prefix for all of the classes and types, and FIT is the obvious choice for that.
    https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Conventions/Conventions.html 

    For the #defines that you are looking for they are named with the three letter prefix FIT, followed by the name of the Type, and then followed by the Value name. For example, since you mentioned the Manufacturer, in FITTypes.h. you will find a typedef for FITManufacturer that is used as the data type for the getters and setters in the messages that use that type, and then a list of #defines for each type i.e. FITManufacturerGarmin. If you start typeing "FITMan" then the auto complete should narrow down the the list of FITManufacturer*** values.  

  • Thank you! That resolves my issue. 

    I also had the same experience as you - in an effort to work around the problem I created a wrapper Swift Package and added the fit-objective-c-sdk as a dependency to it - in that case the cppfit/include directory did show its contents in the Project navigator.

    But in my somewhat limited experience with Swift Packages, this kind of thing is to be expected - the SPM system is pretty slick when it works, but can be very quirky and unpredictable ... Disappointed