Compiling exampleios project on M1 Mac Problem

Former Member
Former Member

Hi there,

I'm brand new to the FIT SDK and relatively new to Swift/Objective-C.

I was trying to run and build the exampleios project XCode file and it gave me the following error:

I'm assuming it's because I'm using the brand new Apple Air with the M1 chip versus the older generations Intel x86-64 chips. 

Even after running this command: 

lipo -info libFitSdkCppiOS.a

It printed the architectures on the static library as: Architectures in the fat file: libFitSdkCppiOS.a are: armv7 i386 x86_64 arm64

What's confusing to me is I thought the M1 processor was arm64?

Would be great if someone had some insight on how to compile it on the new architecture.

Thanks!

  • I have not tried building that project using the new M1 chip, so I do not have an exact answer for you. But one thing to try is, instead of building for "Any iOS Device (arm64, arm7)", try building for a specific device. Just pick any iPhone or iPad from the list. This is an issue with Xcode projects in general and not specific to the M1 processors or the FIT SDK projects. You may still need to remove the x386 architecture from the build targets. Also, click on the option to upgrade to the recommended settings. We build the Objective-C library using an older version of Xcode since it is easier to upgrade the project to work with the latest version of Xcode versus trying to downgrade to an earlier version. You can also rebuild the library. The projects are located at /path/to/fit/sdk/cpp/MacStaticLib/*. Another option is to not use the library and include all the the source code files directly in your project.

    Depending on what you are trying to do, you can also use the C# SDK on a Mac. The Cookbook examples will compile and run using Visual Studio Code (not Visual Studio) on OSX. The Cookbook projects were actually written on a MacBook Pro.
    developer.garmin.com/.../

  • Former Member
    0 Former Member in reply to Ben FIT

    Just one quick note, I did try building from the iPhone 11 Pro; I will try everything else and let you know what happens. 

    Thanks!

  • Note that you can also try to use the parser from https://github.com/roznet/FitFileParser, it is based on the sdk c implementation, adds developer fields and optional generic parsing. 

    It's easy to integrate via swift package manager and It has an iOS example project in https://github.com/roznet/fit-sdk-swift