Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Cannot build with iOS client SDK 3.0.1 #7

Closed
alexpyoung opened this issue May 8, 2019 · 1 comment
Closed

Cannot build with iOS client SDK 3.0.1 #7

alexpyoung opened this issue May 8, 2019 · 1 comment

Comments

@alexpyoung
Copy link

Describe the bug
Attempting to build the hello-react-native app with iOS SDK 3.0.1 fails even though the React Native SDK Podspec allows it

To reproduce

  1. git clone https://github.com/launchdarkly/react-native-client-sdk.git
  2. pushd react-native-client-sdk && npm link && popd
  3. git clone https://github.com/launchdarkly/hello-react-native.git
  4. pushd hello-react-native && npm link launchdarkly-react-native-client-sdk
  5. npm install
  6. pushd ios && sed -i '' 's/3.0.0-beta.3/3.0.1/g' Podfile
  7. pod install
  8. Link glog and DoubleConversion frameworks to React Pod target
  9. react-native link
  10. react-native run-ios

Expected behavior
Building the hello-react-native app with iOS SDK 3.0.x should succeed

Logs

▸ Building Pods/LaunchdarklyReactNativeClient [Debug]
▸ Check Dependencies
▸ Compiling LaunchdarklyReactNativeClient.swift

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:7:39: use of undeclared type 'LDObserverOwner'
    private var listenerKeys: [String:LDObserverOwner] = [:]
                                      ^~~~~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:47:78: cannot assign value of type 'URL' to type 'String?'
            ldConfig.baseUrl = URL.init(string: config["baseUri"] as! String)!
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:59:13: value of type 'LDConfig' has no member 'eventCapacity'
            ldConfig.eventCapacity = config["eventsCapacity"] as! Int
            ^~~~~~~~ ~~~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:63:13: value of type 'LDConfig' has no member 'eventFlushInterval'
            ldConfig.eventFlushInterval = TimeInterval(config["eventsFlushIntervalMillis"] as! Float / 1000)
            ^~~~~~~~ ~~~~~~~~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:67:42: cannot assign value of type 'TimeInterval' (aka 'Double') to type 'NSNumber?'
            ldConfig.connectionTimeout = TimeInterval(config["connectionTimeoutMillis"] as! Float / 1000)
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:71:13: value of type 'LDConfig' has no member 'flagPollingInterval'; did you mean 'pollingInterval'?

            ldConfig.flagPollingInterval = TimeInterval(config["pollingIntervalMillis"] as! Float / 1000)
            ^~~~~~~~ ~~~~~~~~~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:75:13: value of type 'LDConfig' has no member 'backgroundFlagPollingInterval'
            ldConfig.backgroundFlagPollingInterval = TimeInterval(config["backgroundPollingIntervalMillis"] as! Float / 1000)
                        ^

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:83:66: use of unresolved identifier 'LDStreamingMode'
            ldConfig.streamingMode = (config["stream"] != nil) ? LDStreamingMode.streaming : LDStreamingMode.polling
            ^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:87:13: value of type 'LDConfig' has no member 'enableBackgroundUpdates'
            ldConfig.enableBackgroundUpdates = !(config["disableBackgroundUpdating"] as! Bool)
                                                                                             ^~~~~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:91:13: value of type 'LDConfig' has no member 'startOnline'
            ldConfig.startOnline = !(config["offline"] as! Bool)
            ^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:95:13: value of type 'LDConfig' has no member 'isDebugMode'
            ldConfig.isDebugMode = config["debugMode"] as! Bool
            ^~~~~~~~ ~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:102:20: use of unresolved identifier 'LDUser'
        var user = LDUser()
            ^~~~~~~~ ~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:168:40: type 'LDClient' has no member 'shared'
        let stringFlagValue: String? = LDClient.shared.variation(forKey: flagKey)
                                      ^~~~~~~~ ~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:283:42: use of undeclared type 'LDObserverOwner'
        let flagChangeOwner = flagKey as LDObserverOwner
                                         ^~~~~~~~~~~~~~~

❌  /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift:293:17: type 'LDClient' has no member 'shared'
        resolve(LDClient.shared.config.enableBackgroundUpdates)
                                         ^~~~~~~~~~~~~~~

** BUILD FAILED **
The following build commands failed:
	CompileSwift normal x86_64 /Users/alex.young/q/hello-react-native/node_modules/launchdarkly-react-native-client-sdk/ios/LaunchdarklyReactNativeClient.swift
	CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)

SDK version
1.0.1

Language version, developer tools
OS/platform

React Native Environment Info:
  System:
    OS: macOS High Sierra 10.13.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 182.06 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 8.15.1 - ~/.nvm/versions/node/v8.15.1/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v8.15.1/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
  IDEs:
    Android Studio: 3.4 AI-183.5429.30.34.5452501
    Xcode: 10.1/10B61 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.6.3 => 16.6.3
    react-native: 0.57.7 => 0.57.7
  npmGlobalPackages:
    launchdarkly-react-native-client-sdk: 1.0.1
    react-native-cli: 2.0.1

Additional context
I noticed similar logs being discussed in #1. I also see the same behavior when using iOS SDK 3.0.0. I can successfully build 3.0.0-beta.3. One would expect forwards compatibility with newer libraries. One odd thing I noticed is that 3.0.0-beta.3 seems to be completely divergent from master, where the expectation of semantic versioning is that 3.0.0.beta.3 is behind 3.0.0 and 3.0.1

@torchhound
Copy link
Contributor

Hi @alexpyoung iOS SDK version 3.0.1 is completely incompatible with any version of our React Native SDK. Only 3.0.0-beta.x and 4.x.x versions are or will be compatible with React Native. iOS 3.0.1 is written in Objective C while 3.0.0-beta.x and 4.x.x are written in Swift. Versions 2.x.x were bumped to 3.x.x and 3.0.0-beta.x were bumped to 4.x.x to provide support for Xcode 10.2.

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

No branches or pull requests

2 participants