yourkarma / JWT

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

Compilation error: No known class method for selector 'withBase64String' #189

Closed aksonov closed 6 years ago

aksonov commented 6 years ago

JWTAlgorithmDataHolder.m:251 latest master

Btw, Cocoapods 2.2.0 version has a lot of compilation errors too, how to use this package?

lolgear commented 6 years ago

try latest available version: 3.0.0-beta.8

Which target version do you have? ( macOS 10.9 / iOS 8 etc )?

aksonov commented 6 years ago

I tried 3.0.0-beta.8 Target is iOS 11

lolgear commented 6 years ago

@aksonov I recently upload 3.0.0-beta.8 to CocoaPods.

aksonov commented 6 years ago

Just tried again, the result is exactly the same… Where is withBase64String method?

On 16 Mar 2018, at 10:36, Dmitry Lobanov notifications@github.com wrote:

@aksonov https://github.com/aksonov I recently upload 3.0.0-beta.8 to CocoaPods.

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

lolgear commented 6 years ago

@aksonov JWTBase64Coder.h

Could you post your Podfile?

aksonov commented 6 years ago
platform :ios, '9.0'

def testing_pods
    pod 'XMPPFramework', :git => "https://github.com/aksonov/XMPPFramework.git", :branch => '3.7.3'
    pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
    pod 'React', path: '../node_modules/react-native', :subspecs => [
        'Core',
        'RCTActionSheet',
        'RCTAnimation',
        'RCTGeolocation',
        'RCTImage',
        'RCTLinkingIOS',
        'RCTNetwork',
        'RCTSettings',
        'RCTText',
        'RCTVibration',
        'RCTWebSocket',
        'BatchedBridge'
    ]
    pod 'GoogleMaps'
    pod 'RNXMPP', :path => '../node_modules/react-native-xmpp'
    pod 'react-native-mixpanel', path: '../node_modules/react-native-mixpanel'
    pod 'react-native-maps', :path => '../node_modules/react-native-maps'
    pod 'react-native-google-maps', :path => '../node_modules/react-native-maps'
    pod 'CodePush', :path => '../node_modules/react-native-code-push'
    pod 'react-native-blur', :path => '../node_modules/react-native-blur'
    pod 'RNBackgroundGeolocation', :path => '../node_modules/react-native-background-geolocation'
    pod 'RNBackgroundFetch', :path => '../node_modules/react-native-background-fetch'
    pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
    pod 'RSKImageCropper'
    pod 'QBImagePickerController'
    pod 'Firebase/Core'
    pod 'JWT', '~> 3.0.0-beta.8'
    pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
    pod 'Firebase/Auth'
    pod 'BugsnagReactNative', path: '../node_modules/bugsnag-react-native/'
end

target 'tinyrobot' do
    testing_pods
end

target 'tinyrobotStaging' do
    testing_pods
end

target 'tinyrobotTesting' do
    testing_pods
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'react-native-google-maps'
      target.build_configurations.each do |config|
        config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
      end
    end

    if target.name == "React"
      target.remove_from_project
    end
  end
end
lolgear commented 6 years ago

@aksonov Try to delete Podfile.lock and run pod update to fetch latest updates.

aksonov commented 6 years ago

Ooops, looks like I found the reason - CodePush pod uses JWT too and probably it is lower version, so it doesn't see new signature... It looks like I have to fork react-native-codepush module to solve this, right?

lolgear commented 6 years ago

@aksonov I suppose that you can remove JWT from Podfile (it would be installed by CodePush) or install it via subspec of react-native-codepush.

I do not understand why they do it in this way. They could add a dependency in pod spec but they decided to copy ( or add git sub-module ). Because since December ( latest update in their repository ) some necessary bugs have been fixed.

However, you could log your example ( console output + podfile / podfile.lock ) and ask CocoaPods guys about this. If there is no warning about versions collision, you could submit issue/PR in CocoaPods.

aksonov commented 6 years ago

Thank you for the fast reply. I guess Microsoft team did it to allow non-cocoapods installation, so I will wait until they updated your great package.