react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

Android Resulting in a crash upon launch

Open Seamus-melco opened this issue 7 years ago • 4 comments

So i came across this guide, and started following:

https://medium.com/react-native-training/react-native-navigation-v2-by-wix-getting-started-7d647e944132

After getting this set up with the current documentation, from your website. I managed to get the IOS working perfectly fine. However, upon launching and following your guide, i stumbled upon an issue. with the following code:

export default class Initialising extends React.Component {
  async componentDidMount() {
    try {
      const user = await AsyncStorage.getItem(USER_KEY);
      if (user) {
        goHome();
      } else {
        goToAuth();
      }
    } catch (err) {
      goToAuth()
    }
  }
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>Loading</Text>
      </View>
    )
  }
}

In this set of code, i commented out the componentDidMount() it seems to load the app perfectly fine. However, if i uncommented it out it would result in instant crash upon launch. With the following errors:

E/AndroidRuntime: FATAL EXCEPTION: main 
Process: Appname PID:5549
java.lang.RuntimeException: Tried to get null value!

Current information: react-native-cli: 2.0.1 react-native: 0.59.3

Gradle-wrapper: 4.10.2 All build tools : 28.0.0 minSdkVersion: 19 missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5".etc

Steps to reproduce this: react-native init ProjectName https://medium.com/react-native-training/react-native-navigation-v2-by-wix-getting-started-7d647e944132 --follow this tutorial for adding all the files. yarn add react-native-navigation --save https://wix.github.io/react-native-navigation/#/docs/Installing --follow this website for android setup npm run android-linux --should crash upon load.

Seamus-melco avatar Apr 03 '19 13:04 Seamus-melco

Are you check the final code https://github.com/dabit3/react-native-navigation-v2/tree/Part1 Does it also have a problem?

retyui avatar Apr 03 '19 20:04 retyui

@retyui I looked at that, and compared it. Still can't find the real issue, i only know that if i commented out the GoAuth() and GoHome() it doesn't crash.

Seamus-melco avatar Apr 04 '19 01:04 Seamus-melco

@Seamus-melco Can you create a demo repo with this problem?

retyui avatar Apr 04 '19 06:04 retyui

Nevermind, i missed the icon images that resulted in the crash for the android. However, there is a significant difference between the IOS and the android. The IOS shows the footertab, where as the Android doesn't.

Seamus-melco avatar Apr 06 '19 06:04 Seamus-melco