FitnessKit / FitDataProtocol

Swift Implementation the Garmin Flexible and Interoperable Data Transfer Protocol.
https://fitnesskit.github.io/FitDataProtocol/
MIT License
51 stars 15 forks source link

Cannot find 'FITFileEncoder' in scope #25

Closed breiko83 closed 1 year ago

breiko83 commented 1 year ago

Hey - Installed FitDataProtocol via CocoaPod but I'm having troubles using the library for this error: Cannot find 'FITFileEncoder' in scope

Here is my Pod file:

# Uncomment the next line to define a global platform for your project
platform :ios, '15.0'

target 'MyApp' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MyApp
  pod 'Alamofire'
  pod 'FitDataProtocol', '~> 2.1'

  target 'MyAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'MyAppUITests' do
    # Pods for testing
  end
end

And the class:

import Foundation
import FitDataProtocol

func generateFITFile() {
    let encoder = FITFileEncoder(dataValidityStrategy: .none) // build error here
}

I'm using Xcode 14.3 and installed via pod install - no errors or warnings were raised during installation. I was also able to replicate the same error on a new project with no other frameworks installed.

Would you be able to help?

khoogheem commented 1 year ago

Looks like you have FIT in caps try FitFileEncoder(dataValidityStrategy

breiko83 commented 1 year ago

Oh dear. This is embarrassing. Thanks for your help.