parse-community / Parse-SDK-iOS-OSX

The Apple SDK for Parse Platform (iOS, macOS, watchOS, tvOS)
https://parseplatform.org
Other
2.81k stars 865 forks source link

Error in macOS project _OBJC_CLASS_$_PFProductsRequestHandler version 2.0.2 #1699

Closed extnous closed 10 months ago

extnous commented 1 year ago

New Issue Checklist

Issue Description

Getting the following compilation errors

Undefined symbol: _OBJCCLASS$_PFProductsRequestHandler

Parse-SDK-iOS-OSX added with SPM. Errors only app for mac os application. Project for iOS App no compilation errors.

Steps to reproduce

Compile a new mac os project that make use of Parse-SDK-iOS-OSX version 2.0.1 or 2.0.2.

Actual Outcome

Снимок экрана 2023-02-08 в 16 37 24

Expected Outcome

No compilation errors.

Environment

ObjC SDK version: 2.0.2 Mac OS - Ventura 13.0 Apple M1 Pro Xcode - Version 14.2 (14C18)

Client

Server

Database

Logs

parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

rogernolan commented 1 year ago

If you just want to get your project linking and surprise this link error, you can add a stub class to the project with the same name:

PFProductsRecord.h:

#import <Foundation/Foundation.h>
@interface PFProductsRecord : NSObject
@end

and PFProductsRequestHandler.m:

#import "PFProductsRequestHandler.h"
@implementation PFProductsRequestHandler
@end
santiagoprieto commented 1 year ago

I have the same issue. It might be because PFProduct and PFPurchase are unavailable for Mac as marked by the PF_OSX_UNAVAILABLE_WARNING.

Is there an easy way to ensure these unavailable files are not included in the Mac builds? I didn't have this issue when using CocoaPods, but now that we moved to SPM this occurred.

sidan5 commented 1 year ago

Same issue here running MacBook Pro M2.

santiagoprieto commented 10 months ago

This issue is still affecting my app. The interim fix suggested by @rogernolan has not worked for me. If I knew how to fix it in the parse code I would. Help! Anyone?

santiagoprieto commented 10 months ago

This is so frustrating.

santiagoprieto commented 10 months ago

Because of this error the whole Parse-SDK-iOS-OSX should drop the "OSX" from its name. It won't compile since February for Mac apps.

dplewis commented 10 months ago

@santiagoprieto I don't know why PFProduct isn't supported on Mac, probably because StoreKit didn't support Mac at the time of this SDK creation. Looks like it does now from MacOS 10.7+ and StoreKit 2 has been release.

If you want to look into this you can add PF_TARGET_OS_OSX in places required like here for PFPurchase and PFProduct

I've created a PR to fix this issue https://github.com/parse-community/Parse-SDK-iOS-OSX/pull/1739

santiagoprieto commented 9 months ago

@dplewis and @mtrezza you are the best. Thanks for your rad improvement. My app is now compiling perfectly and I'm ready to push a long-awaited update to my users.