React-native-reanimated: [V2] Issue migrating from alpha1 to alpha4 App Crashes

Created on 18 Jul 2020  路  2Comments  路  Source: software-mansion/react-native-reanimated

Description

The app crashes when I launch it. According to Xcode, the issue comes from the file WorkletsCache.cpp line 22 :

std::shared_ptr<jsi::Function> WorkletsCache::getFunction(jsi::Runtime &rt, std::shared_ptr<FrozenObject> frozenObj) {
  long long workletHash = frozenObj->map["__workletHash"]->numberValue;
  if (worklets.count(workletHash) == 0) {
    jsi::Function fun = function(rt, frozenObj->map["asString"]->stringValue);
    std::shared_ptr<jsi::Function> funPtr(new jsi::Function(std::move(fun)));
    worklets[workletHash] = funPtr;
  }
  return worklets[workletHash];
}

Second line :

long long workletHash = frozenObj->map["__workletHash"]->numberValue; // Thread1: EXC_BAD_ACCESS (code=1 address=0x20)

Screenshots

Steps To Reproduce

  1. Build a project with a dependency in alpha version 馃

Expected behavior

Actual behavior

Snack or minimal code example

Package versions

  • React: 16.13.1
  • React Native: 0.63.1
  • React Native Reanimated: 2.0.0-alpha.4

Most helpful comment

Make sure to clear the cache of metro. Seems like it doesn't use the latest version of the babel plugin.

All 2 comments

Make sure to clear the cache of metro. Seems like it doesn't use the latest version of the babel plugin.

Yes you鈥檙e right I got it working after that.

Was this page helpful?
0 / 5 - 0 ratings