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.

Problems reloading Android app while using Reanimated v2

See original GitHub issue

Description

When I reload Android using R + R, everything’s okay. When I reload Android using Cmd + M -> Reload, the app crashes. When I reload Android using the key R in metro console, the app crashes.

Screenshots

https://user-images.githubusercontent.com/8364345/110551740-ff335e00-812d-11eb-9f87-c9ffee59e2ab.mov

Steps To Reproduce

  1. Clone this repo: https://github.com/nelsonprsousa/rnn-testing/tree/test-rea-v2
  2. Use test-rea-v2 branch
  3. yarn android

Expected behavior

The app should reload with Cmd + M -> Reload and when we send the “R” key signal in metro console. iOS works as expected on all the scenarios.

Actual behavior

Android app crashes on reload.

Snack or minimal code example

I’ve made a new react-native application, added react-native-navigation and reanimated v2. Then I added the following code:

import React from 'react';
import {SafeAreaView, StyleSheet, View, Text} from 'react-native';
import Animated, {useAnimatedStyle} from 'react-native-reanimated';

const App: () => React$Node = () => {
  const animated = useAnimatedStyle(() => {
    return {
      transform: [{scale: 1}],
    };
  });

  return (
    <SafeAreaView>
      <Animated.ScrollView
        contentInsetAdjustmentBehavior="automatic"
        style={{backgroundColor: 'gray'}}>
        <View>
          <Text style={styles.footer}>Hello Reanimated v2!</Text>
        </View>
      </Animated.ScrollView>
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  scrollView: {
    backgroundColor: 'white',
  },
  footer: {
    color: 'black',
    fontSize: 12,
    fontWeight: '600',
    padding: 4,
    paddingRight: 12,
    height: 1500,
  },
});

export default App;

Please note that animated const isn’t used. If we comment that const (that’s not being used), everything works as expected. Also tried to really use it and got the same problem, so I am publishing this way for simplicity.

Package versions

  • React: 16.13.1
  • React Native: 0.63.4
  • React Native Reanimated: 2.0.0
  • React Native Navigation: 7.11.3
  • NodeJS: 14.6.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:32 (11 by maintainers)

github_iconTop GitHub Comments

8reactions
teuscmcommented, Apr 27, 2021

Still no luck. I tried to re-install reanimated couple of times. I can’t debug my app and if I use 2.0.0 I get the LogBox timeout and for 2.0.1 I get the reanimated error about installation.

Same issue here. Even after clearing derived data, removing and reinstalling node_modules, clearing metro cache…

Upon further inspection looks like NativeReanimated.useOnlyV1 is always returning true, hence the isConfiguredCheck error, which indicates that somehow InnerNativeModule is null.

@jakub-gonet any ideas on a fix?

6reactions
el-bannacommented, May 6, 2021

I am facing the same problem as you @teuscm. I think NativeReanimated.useOnlyV1 is always returning true too. Did you manage to fix that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem In React Native Reanimated V2.3.0 During Bundling ...
When reloading an app in dev mode on Android it causes the following native crash: 0702 17:33:16.550 31265 31407 F libc : Fatal...
Read more >
Debugging worklets | React Native Reanimated
Reloads don't work - if a debugger is connected to the Reanimated runtime while the reload is performed, the app will crash (both...
Read more >
Why does React Native app crash when clicking on debug in ...
When clicked on reload app crashes and lost connection to debugger. Tried uninstalling and reinstalling apk in emulator and cd android ./gradlew ...
Read more >
Troubleshooting | React Navigation
Now rebuild the app and test on your device or simulator. I'm getting an error "requireNativeComponent: "RNCSafeAreaProvider" was not found in the UIManager"​....
Read more >
react native reanimated not working - You.com | The search ...
1. For anyone that is able to uninstall react-native-reanimated without issues to their application, all I had to do was uninstall the current...
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