optimizely/objective-c-sdk

3.0.0 SDK won't compile because property can't be found on object

jerelevine opened this issue · 13 comments

There's a problem compiling the SDK because a property can't be found on an object.

screen shot 2019-02-20 at 2 34 29 pm

It seems that you forward declare the OPTLYUserProfileService protocol but never actually import the file so it doesn't know that it conforms to NSObject protocol.

Easy to workaround by casting the call to conform to NSObject protocol.

Thanks for submitting! We will look into this.

We're still working to reproduce this issue. Will update you when we have more information. Thanks for your patience.

@jerelevine I think id should be enough that it is a Objective-C object. Have you tried the old delete derived data, restart xcode? Did you still have the issue after that? Also, how are you pod installing? Are you using pod 'OptimizelySDKiOS', '3.0.0'

Hey Thomas, I just created a test project to double check and I'm still running into this issue. I'm using pod 'OptimizelySDKiOS', '3.0.0' and the project is bare otherwise.

I can share the project with you if you have a preferred method.

Also, it doesn't know that it's an Objective-C object. It knows that it's an id with an unknown protocol. Id doesn't automatically translate to Objective-C object sadly. I've run into similar problems before.

There's a great stack overflow answer that seems to explain this issue: https://stackoverflow.com/a/22794940

@jerelevine I don't understand why it works for me. I started with a fresh project and did a pod init pod install and used it without issue. Yeah, if you can share the project, that would be great! What version of Xcode are you running and what platform are you compiling for? Thanks again for the help!

My original project was compiling for iOS 10 but my sample project compiles for iOS 12.1. I added you as a collaborator for my private example repo. Please let me know if you have any trouble accessing it.

Hi Jeremy, could you let us know the version of your Xcode?
We're trying to figure out why it didn't happen in our environment :)

I'm running on Xcode Version 10.1 (10B61) on a Mac running Mohave Version 10.14.3 (18D109)

Thanks, it's the same version as ours here... Not the source of the difference I guessed

@jerelevine we have duplicated the problem. It only occurs in Objective-C apps. Swift apps compile fine. :/ . Thanks for the help. We will provide a patch shortly with an explanation.

Glad to hear you figured out the issue!

@jerelevine We just released v3.0.1 which fixes your build error. Thanks for your help!