rudderlabs / rudder-sdk-ios

iOS SDK for RudderStack - the Customer Data Platform for Developers. Now supports tvOS, watchOS and macOS tracking!
https://www.rudderstack.com
Other
18 stars 39 forks source link

BUG : Compilation fails due to missing method in `RSMetricConfiguration` #529

Closed angelolloqui closed 3 months ago

angelolloqui commented 3 months ago

Describe the bug When trying to install RudderStack v 1.28.0 I get the following compilation error:

No visible @interface for 'RSMetricConfiguration' declares the selector 'initWithLogLevel:writeKey:sdkVersion:' as part of the init of the RSMetricReporter:


- (instancetype)initWithWriteKey:(NSString *)writeKey preferenceManager:(RSPreferenceManager *)preferenceManager andConfig:(RSConfig *)config {
    self = [super init];
    if (self) {
        if (preferenceManager.isMetricsCollectionEnabled || preferenceManager.isErrorsCollectionEnabled) {
            RSMetricConfiguration *configuration = [[RSMetricConfiguration alloc] initWithLogLevel:config.logLevel writeKey:writeKey sdkVersion:RS_VERSION];     //  ---> This line here fails!!
            [configuration dbCountThreshold:config.dbCountThreshold];
            _metricsClient = [[RSMetricsClient alloc] initWithConfiguration:configuration];
            _metricsClient.isMetricsCollectionEnabled = preferenceManager.isMetricsCollectionEnabled;
            _metricsClient.isErrorsCollectionEnabled = preferenceManager.isErrorsCollectionEnabled;
        } else {
            [RSLogger logWarn:@"RSMetricsReporter: Metrics and Errors collection is disabled."]; 
        }
    }
    return self;
}

I am integrating it using Tuist and SPM:

        .package(url: "https://github.com/rudderlabs/rudder-sdk-ios", exact: "1.28.0"),

To Reproduce Steps to reproduce the behaviour:

  1. Setup a new project (preferably using Tuist but I believe it will happen in a vanilla project too)
  2. Add Rudder
  3. Compile and check the error

Expected behavior It should compile without issues

Screenshots Screenshot 2024-08-30 at 11 57 08

Version of the iOS SDK Rudder version 1.28.0 Xcode version 15.4

MoumitaM commented 3 months ago

Hi @angelolloqui, Thank you for raising this. We are looking into it.

angelolloqui commented 3 months ago

Thanks! I believe this change from yesterday is the source: https://github.com/rudderlabs/metrics-reporter-ios/pull/43

It is currently breaking our pipeline, so it is quite urgent for us...

SKannaniOS commented 3 months ago

Hi @angelolloqui,

First of all thank you for raising this issue. Also thank you for proposing the solution by opening the PR. For now we resolved this issue:

Let us know, If this solves your issue.

angelolloqui commented 3 months ago

Hi @SKannaniOS,

I have tried several things, including cleaning all my previous caches and derived data, and all cases seem to work now.

Thanks very much! and great response time!