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

This method(SecRandomCopyBytes) is wrong in Xcode 9 Beta #244

Closed
SpringAndSummer opened this issue Jun 6, 2017 · 11 comments
Closed

This method(SecRandomCopyBytes) is wrong in Xcode 9 Beta #244

SpringAndSummer opened this issue Jun 6, 2017 · 11 comments
Assignees

Comments

@SpringAndSummer
Copy link

extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, uint8_t *bytes) attribute((weak_import));

2017-06-06 19 36 14

@nealwangzi
Copy link

I meet the same thing.

@nserror
Copy link

nserror commented Jun 6, 2017

also seeing the same issue

@aizliang
Copy link

aizliang commented Jun 7, 2017

me too

@ghost
Copy link

ghost commented Jun 7, 2017

The iOS 11 SDK has changed the last parameter of its declaration of SecRandomCopyBytes from uint8_t * to void *, so the declarations no-longer match.

@ghost
Copy link

ghost commented Jun 7, 2017

A workaround for this is to replace the line

extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, uint8_t *bytes) __attribute__((weak_import));

with

extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, void *bytes) __attribute__((weak_import));

or, if you need to support building with previous SDKs too, with

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, void *bytes) __attribute__((weak_import));
#else
extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, uint8_t *bytes) __attribute__((weak_import));
#endif

@honkmaster
Copy link

Could this be fixed?

@rnapier rnapier self-assigned this Jun 11, 2017
@prefect42
Copy link

Nice! Rob is on it!

PS: Nice talk at UIKonf once again!

nathan-r65 added a commit to R65LabsInc/RNCryptor-objc that referenced this issue Jun 20, 2017
@rnapier
Copy link
Member

rnapier commented Jun 21, 2017

Can anyone confirm that they're seeing this in the Swift version (this repository currently holds the Swift version, not the ObjC version; that got moved over to RNCryptor-objc).

@rnapier
Copy link
Member

rnapier commented Jun 21, 2017

Note that this is resolved in the ObjC version; please let me know if anyone is having trouble in the Swift version (I don't think you should be).

@Venkat1128
Copy link

@rnapier I am using pod 'RNCryptor-objc', '~> 3.0' and still i am getting errro at
extern int SecRandomCopyBytes

I can see that pod version is 3.0.2 and which doent have below code .
Can you please suggets how can i resolve this issue .
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, void *bytes) attribute((weak_import));
#else
extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, uint8_t *bytes) attribute((weak_import));
#endif

Thanks,
Venkat

@rnapier
Copy link
Member

rnapier commented Jul 20, 2017

The pod version should be 3.0.5:

https://cocoapods.org/?q=rncryptor-obj

Am I misreading something? (I don't use CocoaPods myself, so this doesn't come up in any of my projects.)

@rnapier rnapier closed this as completed Jul 20, 2017
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

8 participants