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

LDClient.getForMobileKey() was called before init() #79

@ghost

Description

Describe the bug
After updating to latest version of react native (0.64.1) with Hermes enabled and using latest version of launchdarkly-react-native-client-sdk (4.2.0), I get the following error when trying to configure the client: Error: LDClient.getForMobileKey() was called before init()!. It then obviously fails to fetch the flags.

Note: This is only happening on Android

To reproduce

  1. Start a new project using react-native: 0.64.1
  2. Turn on Hermes for both Android
  3. Install latest version of launchdarkly-react-native-client-sdk: 4.2.0
  4. Try to configure the client

Expected behavior
Client should be configured properly and should be able to fetch flags

Logs

Error: LDClient.getForMobileKey() was called before init()!
Error: LDClient.getForMobileKey() was called before init()!
    at promiseMethodWrapper (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:3404:45)
    at isInitialized (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:183558:59)
    at configure (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:183354:31)
    at configureLaunchDarkly$ (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:183256:65)
    at call (native)
    at tryCatch (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:1450:23)
    at invoke (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:1623:32)
    at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:1493:30)
    at call (native)
    at tryCatch (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:1450:23)
    at invoke (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:1523:30)
    at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:1553:19)
    at tryCallTwo (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:28622:9)
    at doResolve (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:28786:25)
    at Promise (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:28645:14)
    at callInvokeWithMethodAndArg (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:1552:33)
    at enqueue (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:1557:157)
    at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:1493:30)
    at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:1574:69)
    at configureLaunchDarkly (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:183235:40)
    at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:183286:30)
    at invokePassiveEffectCreate (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:23151:32)
    at apply (native)
    at invokeGuardedCallbackProd (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:9677:21)
    at apply (native)
    at invokeGuardedCallback (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:9781:42)
    at flushPassiveEffectsImpl (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:23221:36)
    at unstable_runWithPriority (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:51896:30)
    at runWithPriority (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:13504:41)
    at flushPassiveEffects (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:23110:35)
    at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:23006:36)
    at workLoop (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:51847:48)
    at flushWork (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:51822:28)
    at _flushCallback (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:51532:24)
    at apply (native)
    at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:29214:26)
    at _callTimer (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:29130:17)
    at callTimers (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:29339:19)
    at apply (native)
    at __callFunction (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:3894:36)
    at anonymous (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:3618:31)
    at __guard (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:3845:15)
    at callFunctionReturnFlushedQueue (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.airbase&modulesOnly=false&runModule=true:3617:21)

SDK version
"launchdarkly-react-native-client-sdk": "^4.2.0",

OS/platform
Android

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions