KSCrash icon indicating copy to clipboard operation
KSCrash copied to clipboard

Build failure under Xcode 12

Open akornich opened this issue 4 years ago • 8 comments

Build error: KSCrash/Recording/Tools/KSObjC.c:198:54: error: use of undeclared identifier 'kCFCoreFoundationVersionNumber_iOS_8_x_Max'

please see details here: https://github.com/rollbar/rollbar-ios/issues/334

akornich avatar Nov 19 '20 00:11 akornich

im having this issue as well. Could you provide more detail for reasons and the solution used in rollbar-ios? Don't we need arm64 architecture?

ftcvlad avatar Nov 19 '20 10:11 ftcvlad

@ftcvlad , we do not really have a solution. it is more like a workaround until KSCrash introduces a proper fix. It looks like the solution needs to be on the KSCrash side. If I still remember correctly the details, the build error was introduced by conditional compilation for arm64 targeting macOS. As the result, KSCrash reporter attempts to use an Apple defined constant that does not exist under macOS (or something like that - i'll try to look up my notes with the name of the constant ia bit later and will add it here).

akornich avatar Dec 01 '20 04:12 akornich

@ftcvlad , oops, apparently, I already posted the name of the constant at the time I opened this issue (see my very first/initial comment here)...

akornich avatar Dec 01 '20 04:12 akornich

Is there any fix available for this issue? @akornich

saravanan-selvam avatar Dec 15 '20 04:12 saravanan-selvam

@saravanan-selvam , not as far as I know. I tried to have a workaround for this by playing with the build setting on our side - but without any success so far. Didn't Apple drop support of iOS 8 in Xcode 12? I have a feeling you, guys, need to replace the condition involving kCFCoreFoundationVersionNumber_iOS_8_x_Max using an alternative constant supported by Xcode 12?

akornich avatar Jan 08 '21 18:01 akornich

Add missing file in directory KSCrash/swift/Basic to group Crash Recording/Support/swift/Basic.

XjShi avatar Jan 27 '21 02:01 XjShi

@saravanan-selvam , not as far as I know. I tried to have a workaround for this by playing with the build setting on our side - but without any success so far. Didn't Apple drop support of iOS 8 in Xcode 12? I have a feeling you, guys, need to replace the condition involving kCFCoreFoundationVersionNumber_iOS_8_x_Max using an alternative constant supported by Xcode 12?

@akornich Thanks for the response, Since macOS (Apple Silicon) supports arm64 from Xcode 12, KSCrash started to throw error while trying to compile for macOS. So I just added a '#if !TARGET_OS_OSX' macro check inside conditional arm64 check '#if defined(arm64)' and now it works.

#if defined(arm64) #if !TARGET_OS_OSX if (floor(kCFCoreFoundationVersionNumber) <= kCFCoreFoundationVersionNumber_iOS_8_x_Max) { return (const struct class_t*)(isa & ISA_MASK_OLD); } #endif return (const struct class_t*)(isa & ISA_MASK); #else

saravanan-selvam avatar Jan 29 '21 04:01 saravanan-selvam

@saravanan-selvam , thank you! Is the change already in? I do not see any commit linked to this issue...

akornich avatar Feb 10 '21 17:02 akornich