Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicit declaration of function 'SecCopyErrorMessageString' is invalid in C99 #202

Open
vladarefiev opened this issue Aug 15, 2018 · 11 comments

Comments

@vladarefiev
Copy link

vladarefiev commented Aug 15, 2018

Issue Info

Info Value
Platform Name ios
Xcode Version Xcode 9.0
Deployment target 9.0
Base SDK Latest iOS (iOS 11.0)

Issue Description and Steps

Hi there,
I have a problems with building project.
Implicit declaration of function 'SecCopyErrorMessageString' is invalid in C99 in the JWTCryptoSecurity+ErrorHandling.m file.

if (@available(iOS 11.3, *)) {
        NSString *message = (NSString *)CFBridgingRelease(SecCopyErrorMessageString(status, NULL)) ?: @"Unknown error message";
        return [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:@{NSLocalizedDescriptionKey : message}];
    }
@lolgear
Copy link
Collaborator

lolgear commented Aug 15, 2018

@vladarefiev
Hi!
Please, post Deployment target and Base SDK versions.

@vladarefiev
Copy link
Author

@lolgear added to issue description.

@lolgear
Copy link
Collaborator

lolgear commented Aug 15, 2018

@vladarefiev
Weird.
How do you compile this project?
Please, also post commit hash.

@vladarefiev
Copy link
Author

@lolgear
I have just checked project out to clear directory, installed all deps.
Then I had You should run pod update CodePush to apply changes you've made.
After that my Podfile.lock has been changed.

-  - CodePush (5.4.0):
+  - CodePush (5.4.1):

-  - JWT (3.0.0-beta.8):
+  - JWT (3.0.0-beta.11):

Product -> Build -> Build failed

image

@lolgear
Copy link
Collaborator

lolgear commented Aug 17, 2018

@vladarefiev
Fixing problems in Apple ecosystem.

Xcode rules

  1. Product -> Build -> Clean Build Folder.
  2. Relaunch Xcode.
  3. Update Xcode from AppStore/Developer Beta.

MacOS rules

  1. Restart MacOS.
  2. Reset PRAM.
  3. Reset SMC.

iPhone rules

  1. Buy new.

@lolgear
Copy link
Collaborator

lolgear commented Aug 26, 2018

@vladarefiev
Did you solve it by "Clean" action in Xcode or by removing DerivedData folder?

@fluiddot
Copy link

fluiddot commented Sep 6, 2018

any update on this?
It's happening to me too.

@lolgear
Copy link
Collaborator

lolgear commented Sep 7, 2018

@fluiddot
Hi!
Could you attach example project and all necessary tools versions. ( Xcode, deployment target etc. )

@agonbina
Copy link

So I ran into the same issue and I solved it by upgrading xcode to 9.4.1 (previously I had 9.2.x).

I only figured this out because I had selected the 9.4.1 version of xcode to build in my appcenter settings, where the building was working perfectly fine, whereas on my local machine with an older version of xcode the build was failing for this exact same reason.

@hellChine
Copy link

image
this API just active on iphone_11.3 or later.

@sryze
Copy link

sryze commented Sep 17, 2020

Same error on Xcode 9.2 (I'm using an old Sierra Hackintosh, can't update it).

I think it needs to be replaced this with a compile-time check with #if ... #endif` so that it actually compiles with older SDKs, .e.g

    #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110300)
        NSString *message = (NSString *)CFBridgingRelease(SecCopyErrorMessageString(status, NULL)) ?: @"Unknown error message";
        return [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:@{NSLocalizedDescriptionKey : message}];
    #endif
    return [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:nil];

BTW my SDK version is 11.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants