Skip to content

Error thrown when .setItem is run inside project #13

@odonckers

Description

@odonckers

My project is built with the Ignite CLI (Bowser) and my intention is to fully support iCloud sync which should be easy if I can swap out the React Native Community Async Storage project with this one. But it seems that the JavaScript and native code are out of sync. When running .setItem it throws the following error:

RNICloudStorage.setItem was called with 3 arguments but expects 2 arguments. If you haven't changed this method yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.

I've tried completely uninstalling all packages, removed automatic linking and replaced with manual and nothing seems to fix the error. I'm only passing two arguments as you can see bellow in my code:

export const saveString = async (key: string, value: string): Promise<boolean> => {
  try {
    await AsyncStorage.setItem(key, value)
    return true
  } catch {
    return false
  }
}

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions