yourkarma / JWT

A JSON Web Token implementation in Objective-C.
MIT License
351 stars 107 forks source link

ld: library not found for -lBase64 #153

Closed rmorgancafex closed 6 years ago

rmorgancafex commented 6 years ago

Hi, I am getting the above error when trying to build my cocoapods project, is there something I am missing?

"ld: library not found for -lBase64"

lolgear commented 6 years ago

@rmorgancafex Hi! Could you describe whole process and/or attach sample project?

rmorgancafex commented 6 years ago

Hi @lolgear - thanks for the quick reply...

I am just trying to create a jwt token from a random payload. So far I have included the JWT lib via cocoapods and added this code to my view controller:

    NSDictionary *payload = @{@"payload" : @"hidden_information"};
    NSString *algorithmName = @"RS256";

    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"certificate.p12" ofType:@"p12"];
    NSData *privateKeySecretData = [NSData dataWithContentsOfFile:filePath];

    NSString *passphraseForPrivateKey = @"secret";

    JWTBuilder *builder = [JWTBuilder encodePayload:payload];
    NSString *token = builder.encode;

    NSLog(@"token: %@", token);

I've also added the .p12 to my app bundle.

lolgear commented 6 years ago

@rmorgancafex Could you post your pod file here? Do you enable use_frameworks! option?

rmorgancafex commented 6 years ago

Not from the looks of this ...

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'mschat-finance-sample' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for mschat-finance-sample
  pod "JWT"
  pod "Base64"
end
lolgear commented 6 years ago

@rmorgancafex Could you upload sample project with this setup? I suppose that commenting line pod "Base64" could fix issue.

rmorgancafex commented 6 years ago

No joy, I'm afraid... still get this error -

ld: framework not found -lBase64

Here's my Other Linker Flags:

$(inherited) -ObjC -framework

lolgear commented 6 years ago

@rmorgancafex could you post sample project with your setup?

rmorgancafex commented 6 years ago

@lolgear Sorry, I can't post the sample project

lolgear commented 6 years ago

@rmorgancafex I need more information to fix this issue if it exists in your setup. Could you create a new project with exact behavior that you encountered?

lolgear commented 6 years ago

@rmorgancafex any updates?

rmorgancafex commented 6 years ago

Yes, sorry. I added in the base64 framework and it worked :) Thanks for your help!

On 17 October 2017 at 17:31, Dmitry notifications@github.com wrote:

@rmorgancafex https://github.com/rmorgancafex any updates?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yourkarma/JWT/issues/153#issuecomment-337279148, or mute the thread https://github.com/notifications/unsubscribe-auth/AXJv3jBZSt5I9flIH8IxuQLt72eFTJ_Vks5stNZkgaJpZM4P2zmr .

-- --

Richard Morgan Developer Advocate

CaféX Communications, 3 Eastern Business Park, Wern Fawr Lane, St Mellons, Cardiff, CF3 5EA rmorgan@cafex.com

Follow us on LinkedIn http://www.linkedin.com/company/3288106?trk=tyah&trkInfo=tas%3Acafex%2Cidx%3A1-1-1

--


Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. CafeX Communications.

lolgear commented 6 years ago

@rmorgancafex no problem! Could you describe your case (the problem and the solution) in nutshell to prevent further questions in this topic?

lolgear commented 6 years ago

@rmorgancafex could be closed?

rmorgancafex commented 6 years ago

Yes. Thanks

esutton commented 4 years ago

@rmorgancafex How did you do this exactly? In the Podfile?

Yes, sorry. I added in the base64 framework and it worked :)

morganric commented 4 years ago

Sorry @esutton - too long ago to remember ... possibly?