question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

toValue error dialog because of getValue() in ReadableNativeMap.java

See original GitHub issue

screenshot_2019-02-02-14-41-00-553_com sharwinbobde musicstreaming

Please ignore duplicate issue #23267 keep this as the issue

Environment

React Native Environment Info: System: OS: Linux 4.15 Ubuntu 16.04.5 LTS (Xenial Xerus) CPU: (4) x64 Intel® Core™ i5-5200U CPU @ 2.20GHz Memory: 125.41 MB / 7.70 GB Shell: 4.3.48 - /bin/bash Binaries: Node: 8.15.0 - /usr/bin/node npm: 6.4.1 - /usr/bin/npm SDKs: Android SDK: API Levels: 23, 25, 26, 27, 28 Build Tools: 27.0.3, 28.0.2, 28.0.3 System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 npmPackages: react: 16.6.3 => 16.6.3 react-native: ^0.57.8 => 0.57.8 npmGlobalPackages: react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7 react-native-rename: 2.4.0

Description

Error dialog saying ‘toValue’ pops up. I am aware about the potential Fix #19808 reported for issue #19793 Safely unwrapping ReadableMap by defaulting to 0 if key not present seems to be not working.

Code Snippets

node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeMap.java

@Override
  public boolean hasKey(String name) {
    if (mUseNativeAccessor) {
      mJniCallCounter++;
      return hasKeyNative(name);
    }
    return getLocalMap().containsKey(name);
  }

private Object getValue(String name) {
    if (hasKey(name) && !(isNull(name))) {
      return Assertions.assertNotNull(getLocalMap().get(name));
    }
    throw new NoSuchKeyException(name);
  }

  private <T> T getValue(String name, Class<T> type) {
    Object value = getValue(name);
    checkInstance(name, value, type);
    return (T) value;
  }
  @Override
  public double getDouble(String name) {
    if (mUseNativeAccessor) {
      mJniCallCounter++;
      return getDoubleNative(name);
    }
    return getValue(name, Double.class).doubleValue();
  }

node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/FrameBasedAnimationDriver.java

  @Override
  public void resetConfig(ReadableMap config) {
    ReadableArray frames = config.getArray("frames");
    int numberOfFrames = frames.size();
    if (mFrames == null || mFrames.length != numberOfFrames) {
      mFrames = new double[numberOfFrames];
    }
    for (int i = 0; i < numberOfFrames; i++) {
      mFrames[i] = frames.getDouble(i);
    }
    mToValue = config.hasKey("toValue") ? config.getDouble("toValue") : 0; // hasKey() is returning true
    mIterations = config.hasKey("iterations") ? config.getInt("iterations") : 1;
    mCurrentLoop = 1;
    mHasFinished = mIterations == 0;
    mStartFrameTimeNanos = -1;
  }

Reproducible Demo

Exception is very difficult to recreate

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
miticouscommented, Mar 23, 2019

Same problem @0.59 -rn v

0reactions
react-native-botcommented, Feb 28, 2019

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

com.facebook.react.bridge.ReadableNativeMap.getValue
In the firebase crash report, it's not showing any line number its coming with "???" Am not find any answer related to this...
Read more >
react-native/CHANGELOG.md - UNPKG
getAllResponseHeaders() now returns headers with names lowercased and sorted in ... 178, - fix: jvm 11 error message from ReactPlugin.kt and react.gradle ...
Read more >
@react-native/eslint-plugin-specs | Yarn - Package Manager
Fix error "mockModal is not a function" (507b05f4c0 by @AntoineDoubovetzky); Fixes execution of animation when a toValue of AnimatedValue is used.
Read more >
Issues following upgrade to 1.75.1 (SOLVED) - Android
Because of this I thought it could be fixed by just upgrade to 1.75.1 ... getValue(ReadableNativeMap.java:124) at com.facebook.react.bridge.
Read more >
InspectorPackagerConnection.java example - Javatips.net
ComicBook-master. android. app. build. generated. source. buildConfig. debug. com. comicbook. BuildConfig.java. r. debug. android. support. v7. appcompat.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found